Date: Thu, 3 Jul 2003 16:49:31 +0200 From: Nicolas George To: lablgtk at kaba.or.jp Cc: Richard Jones Subject: Re: containers & subclasses of widgets Message-ID: <20030703144931.GA29657 at clipper.ens.fr> Reply-To: lablgtk at kaba.or.jp References: <20030703144222.GA15588 at redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <20030703144222.GA15588 at redhat.com> --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le quintidi 15 messidor, an CCXI, Richard Jones a =E9crit=A0: > I guess this comes down to the strange type system used by LablGtk. No, it has to do with static typing. The children of a container are widgets, nothing more: they could be labels, input boxes, images, anything. The static type system of Caml has no way to know that they will be vboxes. You could use the dynamic type checking facilities of Gtk+ to refine the widget into a vbox, but I believe this is a bad style. If you need to do something to some widget, do not rely on accessing it through its parents: store it in a variable with a relevant name. This way you will have reliable static typing, and your code will not break if you change the layout of your widgets. --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE/BEJ6sGPZlzblTJMRAgI7AKCYuaWJt1jSvpD2EpGNZpNxSi2/SgCgpHjV iILGGfBvPBu6H+ZqK819KOI= =s6D+ -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--