I am trying to create my own GTK widget by subclassing Gtk.Bin. I do not use the GUI constructor. This widget will contain several standard Gtk widgets (VBoxs, Labels, Buttons, etc.).
public class MyWidget : Gtk.Bin
{
public MyWidget : base ()
{
build ();
}
private void build ()
{
VBox vbox1 = new Vbox (true, 0);
vbox1.PackStart (new Label ("MyWidget"), true, true, 0);
this.Add (vbox1);
}
}
Meanwhile, when I add my own widget to the main window, I see nothing. Other Windows controls appear, space is allocated for this custom widget. I expect to see the “MyWidget” label in my space, but nothing appears. I go through the code in the debugger and everything calls it, but it doesn't show at runtime.
Any help would be appreciated.
source
share