[Gtk-sharp-list] Glade & Viewport

Todd Berman tberman@off.net
Sun, 29 Aug 2004 04:23:48 -0400


On Sun, 2004-08-29 at 10:15 +0200, Freon wrote:
> Something like this should work:
> 
>                         [Widget] protected Widget yourWidget = null;
>                         ...
>                          Glade.XML gxml = new Glade.XML("gui.glade",
> "yourWidget", null);
>                         gxml.Autoconnect (this);
>                         this.viewPort.Add(yourWidget);
> 
> Of course, this widget needs to be placed inside a window in Glade,
> but you don't have to use it.

That is asking for trouble. Lots and lots of ugly trouble.

If you go and look at the MonoDevelop source, there is a class called
GladeWidget. You can write code that subclasses that widget, and it
abstracts the reparenting and adding of the widgetry. We use it inside
MonoDevelop for all of the option dialogs and such.

--Todd