]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/label.ml
"Final" commit that patches termViewer while still enabling XML Diffing.
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20000829-0.1.0 / examples / label.ml
1 (* $Id$ *)
2
3 (* Embedding xpm data into an ML file *)
4
5 let openfile = [|
6 (* width height num_colors chars_per_pixel *)
7 "    20    19       5            1";
8 (* colors *)
9 ". c None";
10 "# c #000000";
11 "i c #ffffff";
12 "s c #7f7f00";
13 "y c #ffff00";
14 (* pixels *)
15 "....................";
16 "....................";
17 "....................";
18 "...........###......";
19 "..........#...#.#...";
20 "...............##...";
21 "...###........###...";
22 "..#yiy#######.......";
23 "..#iyiyiyiyi#.......";
24 "..#yiyiyiyiy#.......";
25 "..#iyiy###########..";
26 "..#yiy#sssssssss#...";
27 "..#iy#sssssssss#....";
28 "..#y#sssssssss#.....";
29 "..##sssssssss#......";
30 "..###########.......";
31 "....................";
32 "....................";
33 "...................." |]
34
35 open GMain
36
37 let main () =
38   let w = GWindow.window ~border_width:2 () in
39   w#misc#realize ();
40   let hbox = GPack.hbox ~spacing:10 ~packing:w#add () in
41   let pm = GDraw.pixmap_from_xpm_d ~data:openfile ~window:w () in
42   GMisc.pixmap pm ~packing:hbox#add ();
43   GMisc.label ~text:"Embedded xpm" ~packing:hbox#add ();
44   w#show ();
45   w#connect#destroy ~callback:Main.quit;
46   Main.main ()
47
48 let () = main ()