[Gtk-sharp-list] Re: Some questions about layout management in Gtk# 2.0

Eric Butler eric at extremeboredom.net
Sat May 14 14:16:32 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Thomsen wrote:
> 1) How do you put two elements such as a label and a combobox in a 2
> element VBox and have them set to be variable sizes? Let's say I want
> the label to take up 20% of the space and the comobox to take up 80%
> of the space. Is this even possible with Gtk#'s layout management?

I do not believe Gtk supports percentage widths, but I think you will
find that it's generally not something you need. You can place your
label and widget in either a GtkTable or GtkHBox to have it size them
properly.

If you do not believe this will work for you, please reply with a more
specific explination of what you wish to achieve.

> 2) When I try to reference a ComboBox object marked with a [Widget]
> attribute from a Glade file, my test program crashes. Could someone
> explain why this happens? Below is the code in question:

I am assuming you are getting a type cast exception. If I am wrong, you
should post the error!!! In glade, select the widget and look in the
Properties window under "Class". You are probably using a
GtkComboBoxEntry (Gtk.ComboBoxEntry) instead of a GtkComboBox, or
something to that effect.

Regards,
Eric
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFChkB6sSPwEOmqwCIRAoqrAJ9DxUIdw2Gz5c49+KGsA8bheDHDgwCfVhlP
TQ9jN/+LwT+ZggQUbECDLeg=
=LWdO
-----END PGP SIGNATURE-----


More information about the Gtk-sharp-list mailing list