1999-11-30 06:59:39 -08:00
|
|
|
(* $Id$ *)
|
|
|
|
|
|
|
|
open Tk
|
|
|
|
|
|
|
|
let create ?:command ?:width ?:textvariable parent =
|
|
|
|
let ew = Entry.create parent ?:width ?:textvariable in
|
|
|
|
Jg_bind.enter_focus ew;
|
|
|
|
begin match command with Some command ->
|
1999-12-16 00:37:38 -08:00
|
|
|
bind ew events:[`KeyPressDetail "Return"]
|
|
|
|
action:(fun _ -> command (Entry.get ew))
|
1999-11-30 06:59:39 -08:00
|
|
|
| None -> ()
|
|
|
|
end;
|
|
|
|
ew
|