List Info

Thread: "ocaml_beginners"::[] How does Tk.bind work?




"ocaml_beginners"::[] How does Tk.bind work?
country flaguser name
United States
2007-04-05 20:20:29

this is in revised syntax:

open Tk;

value root = opentk ();

value entry = Entry.create root;

bind ~events:[`KeyPress] ~action:(fun event -> Printf.fprintf stdout
"%in" event.ev_KeyCode) entry;

pack [entry];

mainLoop ();

Running MacOS X, upon entering text into the entry box, all I ever see
in stdout is 0. This doesn't seem quite right with me. Any comments or
suggestions?

PS my intent is that in a more complicated UI, pressing the enter key
should do the same thing as pushing the OK UI button.

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] Re: How does Tk.bind work?
country flaguser name
United States
2007-04-05 21:41:39

I just got the same result under windows.

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )