diff options
Diffstat (limited to 'otherlibs/labltk/browser/jg_entry.ml')
-rw-r--r-- | otherlibs/labltk/browser/jg_entry.ml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/otherlibs/labltk/browser/jg_entry.ml b/otherlibs/labltk/browser/jg_entry.ml new file mode 100644 index 000000000..d9109d83a --- /dev/null +++ b/otherlibs/labltk/browser/jg_entry.ml @@ -0,0 +1,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 |