[Gtk-sharp-list] Do you subclass Gtk.Dialog when using Glade#?

Darren Warner gtk-sharp at dazwin.com
Tue Jun 27 00:08:38 EDT 2006


It seems to me that whether a dialog is based on glade or not should be 
transparent to the client (i.e. both glade and non-glade dialogs should 
be derived from Gtk.Dialog). However, I can't find a way to do this - 
there doesn't seem to be a way to get glade to connect the top-level 
widget to the class itself (giving the class and the widget the same 
name results in a null reference exception).

By encapsulating the dialog widget as a property, I usually end up 
needing to add proxies for Run(), DestroyWindow(), and something to set 
the dialog's TransientFor, which all seems a bit unnecessary. Am I doing 
something wrong here?

I could combine them into a single function, but there are problems 
calling DestroyWindow() before obtaining widget values. Specifically, if 
you set the 'Text Visible' property of a Gtk.Entry to true, .Text is 
empty after DestroyWindow() is called. Other widgets seem to be Ok, so 
is this a bug, or do widgets essentially go out of scope and it's best 
to avoid touching them altogether?



More information about the Gtk-sharp-list mailing list