(************************************************************ radio.ml Created : Mon Nov 24 19:17:31 2003 Last modified: Mon Nov 24 19:34:28 2003 Compile: ocamlc -dtypes -I +labltk labltk.cma radio.ml -o radio # FTP Directory: sources/ocaml # ************************************************************) (** @author Takashi Masuyama *) open Tk let _ = let window = openTk () in let selected_name = Textvariable.create ~on:window () in let mamewo = Radiobutton.create window ~text:"mamewo" ~variable:selected_name ~value:"mamewo" in let tak = Radiobutton.create window ~text:"tak" ~variable:selected_name ~value:"tak" in let button = Button.create window ~text:"OK" in Radiobutton.select mamewo; bind button ~events:[`ButtonPressDetail 1] ~action:(fun _ -> print_endline (Textvariable.get selected_name)); pack [mamewo; tak]; pack [button]; mainLoop () ;;