Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] lablGtk - newbie question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-06 (14:36)
From: Andrew Lawson <andrew@a...>
Subject: [Caml-list] lablGtk - newbie question
Hi all
	I've just started learning ocaml and lablGtk. I'm writing a
small utility and I'm trying to encapsulate the gui in a class, a
simplified example is below;

class mainWindow () =
    object (self)
	val winMain = GWindow.window ~title:"Cadb" ~border_width:10
i					~width:400 ~height:400 ()
	val butNew = GButton.button ~label:"New" ()
	    winMain#add butNew; (* This would seem the obvious thing to
do but it doesn't work *)
	    winMain#connect#destroy ~callback:Main.quit;
	    winMain#show ()

	Now I have to pack the button into the window, obviously I can't
do it in the val expression but I can't work out how to do it in the
initializer. Can someone help?


   Andrew Lawson
Swindon, Wilts, Uk
Bug reports:  FAQ:
To unsubscribe, mail  Archives: