From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA00181; Sat, 6 Oct 2001 16:36:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA00266 for ; Sat, 6 Oct 2001 16:36:10 +0200 (MET DST) Received: from mail12.svr.pol.co.uk (mail12.svr.pol.co.uk [195.92.193.215]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f96Ea9X22435 for ; Sat, 6 Oct 2001 16:36:10 +0200 (MET DST) Received: from modem-1129.grommet.dialup.pol.co.uk ([62.25.174.105] helo=alba.sw) by mail12.svr.pol.co.uk with esmtp (Exim 3.13 #0) id 15psYj-0003TS-00 for caml-list@inria.fr; Sat, 06 Oct 2001 15:36:09 +0100 Received: by alba.sw (Postfix, from userid 1001) id 562B4B60; Sat, 6 Oct 2001 15:34:39 +0100 (BST) Date: Sat, 6 Oct 2001 15:34:39 +0100 From: Andrew Lawson To: caml-list@inria.fr Subject: [Caml-list] lablGtk - newbie question Message-ID: <20011006153439.A882@alba.sw> Reply-To: Andrew Lawson Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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