1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
(**************************************************************************)
(* Lablgtk - Examples *)
(* *)
(* This code is in the public domain. *)
(* You may freely copy parts of it in your application. *)
(* *)
(**************************************************************************)
(* $Id$ *)
(* これを実行する前にLC_ALL=ja_JP.EUCなどと指定しなければならない *)
open GMain
let window = GWindow.window ()
let box = GPack.vbox ~packing: window#add ()
let text = GText.view ~packing: box#add ()
let button = GButton.button ~label: "終了" ~packing: box#add ()
let label = GMisc.label ~text:"これには影響しない" ~packing: box#add ()
let _ =
window#connect#destroy ~callback:Main.quit;
text#buffer#insert "こんにちは";
text#misc#set_size_chars ~width:20 ~height:5 ();
let style = button#misc#style#copy in
button#misc#set_style style;
style#set_bg [`NORMAL,`NAME "green"; `PRELIGHT,`NAME "red"];
button#connect#clicked ~callback:Main.quit
let _ =
window#show ();
Main.main ()
|