6 let window = GWindow.window () in
7 window#connect#destroy ~callback:Main.quit;
9 let text = GEdit.text ~editable:true ~packing:window#add () in
10 text#event#connect#button_press ~callback:
12 GdkEvent.Button.button ev = 3 &&
13 GdkEvent.get_type ev = `BUTTON_PRESS &&
15 let pos = text#position in
16 GdkEvent.Button.set_button ev 1;
17 text#event#send (GdkEvent.coerce ev);
18 Printf.printf "Position is %d.\n" text#position;
20 text#set_position pos;