caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andrew Lawson <andrew@absentis.com>
To: caml-list@inria.fr
Subject: [Caml-list] lablGtk - newbie question
Date: Sat, 6 Oct 2001 15:34:39 +0100	[thread overview]
Message-ID: <20011006153439.A882@alba.sw> (raw)

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


             reply	other threads:[~2001-10-06 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-06 14:34 Andrew Lawson [this message]
2001-10-06 19:36 ` Maxence Guesdon
2001-10-06 22:50 ` Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011006153439.A882@alba.sw \
    --to=andrew@absentis.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).