blob: d9109d83afca351b6f40229c6c723c380e4dd9fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
(* $Id$ *)
open Tk
let create :parent ?:command ?:width ?:textvariable () =
let ew = Entry.create :parent ?:width ?:textvariable () in
Jg_bind.enter_focus ew;
begin match command with Some command ->
bind ew events:[[], `KeyPressDetail "Return"]
action:(`Set ([], fun _ -> command (Entry.get ew)))
| None -> ()
end;
ew
|