File: test.ml

package info (click to toggle)
planets 0.1.13-6
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 396 kB
  • ctags: 585
  • sloc: ml: 2,838; makefile: 105; ansic: 38
file content (19 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open Tk
open Printf

let toplevel = openTk ~clas:"Options" () 
let entry = Entry.create toplevel

let action ev = 
  if ev.ev_KeySymString = "Return" then
    begin
      printf "%s" (Entry.get entry);
      print_newline ()
    end

let _ = 
  bind ~events:[`KeyPress] ~fields:[`KeySymString] ~action entry;
  Pack.configure [entry]; 
  mainLoop ()