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

Michael Thomsen mikerthomsen at gmail.com
Sat May 14 13:20:35 EDT 2005

I am used to Swing's layout management and Windows Forms' layout
management, but there are some things that I haven't been able to
figure out how do with Gtk#.

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?

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:

using Gtk;
using Glade;

public class Test
	[Widget]ComboBox combobox1;
	public Test()
		Glade.XML gxml = new Glade.XML(null, "project1.glade", "window1", null);
	public static void Main(string[] args)
		new Test();

3) How do you get and set the contents of a ComboBox object?

Any help would be appreciated.

More information about the Gtk-sharp-list mailing list