X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Flablgtk%2Flablgtk_20000829-0.1.0%2Fexamples%2Flabel.ml;fp=helm%2FDEVEL%2Flablgtk%2Flablgtk_20000829-0.1.0%2Fexamples%2Flabel.ml;h=b9829fb7783df032e41ae9c0d833c5c3990fb4fe;hb=2ee84a2a641938988703e329aef9fc3c5eb5aacf;hp=0000000000000000000000000000000000000000;hpb=34d83812af9b7064cc8f735c2a78169881140010;p=helm.git diff --git a/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/label.ml b/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/label.ml new file mode 100644 index 000000000..b9829fb77 --- /dev/null +++ b/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/label.ml @@ -0,0 +1,48 @@ +(* $Id$ *) + +(* Embedding xpm data into an ML file *) + +let openfile = [| +(* width height num_colors chars_per_pixel *) +" 20 19 5 1"; +(* colors *) +". c None"; +"# c #000000"; +"i c #ffffff"; +"s c #7f7f00"; +"y c #ffff00"; +(* pixels *) +"...................."; +"...................."; +"...................."; +"...........###......"; +"..........#...#.#..."; +"...............##..."; +"...###........###..."; +"..#yiy#######......."; +"..#iyiyiyiyi#......."; +"..#yiyiyiyiy#......."; +"..#iyiy###########.."; +"..#yiy#sssssssss#..."; +"..#iy#sssssssss#...."; +"..#y#sssssssss#....."; +"..##sssssssss#......"; +"..###########......."; +"...................."; +"...................."; +"...................." |] + +open GMain + +let main () = + let w = GWindow.window ~border_width:2 () in + w#misc#realize (); + let hbox = GPack.hbox ~spacing:10 ~packing:w#add () in + let pm = GDraw.pixmap_from_xpm_d ~data:openfile ~window:w () in + GMisc.pixmap pm ~packing:hbox#add (); + GMisc.label ~text:"Embedded xpm" ~packing:hbox#add (); + w#show (); + w#connect#destroy ~callback:Main.quit; + Main.main () + +let () = main ()