caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] lablGtk - newbie question
@ 2001-10-06 14:34 Andrew Lawson
  2001-10-06 19:36 ` Maxence Guesdon
  2001-10-06 22:50 ` Jacques Garrigue
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Lawson @ 2001-10-06 14:34 UTC (permalink / raw)
  To: caml-list

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" ()
	initializer
	    winMain#add butNew; (* This would seem the obvious thing to
do but it doesn't work *)
	    winMain#connect#destroy ~callback:Main.quit;
	    winMain#show ()
    end

	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
-- 

   Andrew Lawson
andrew@absentis.com
Swindon, Wilts, Uk
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-08  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-06 14:34 [Caml-list] lablGtk - newbie question Andrew Lawson
2001-10-06 19:36 ` Maxence Guesdon
2001-10-06 22:50 ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).