File: test.ml

package info (click to toggle)
planets 0.1.13-19
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 512 kB
  • sloc: ml: 4,541; makefile: 207; ansic: 38
file content (19 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (9)
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 ()