[Gtk-sharp-list] Extending Gtk.Window

Pablo Fischer pablo@pablo.com.mx
Thu, 20 Nov 2003 16:10:30 -0600


El jue, 20-11-2003 a las 15:37, Miguel de Icaza escribi=F3:
> There are a few problems with your code:
> 	* The instance that is created by Glade is not of type AccountsWindow,
> 	  it is of type `Window'.
You are telling me about this lines:

accountsWindow =3D (Gtk.Window)ui["accountsWindow"];
this =3D accountsWindow;

If yes, I'm sorry to upload the file with that error, It should not have 't=
his =3D accountsWindow'.=20

> 	* You are not allowed to assign to `this', MCS flags that as an error,
> 	  you might be using an old version, and that explains the corruption.
So, the best option is to never use 'this', right? And if I'm extending
my application from another Class and want to use properties or members
of the extended class I should use them like: Visible and not like

> I would suggest that you do have a container class that holds all the
> information, but does not necessarily derive from Window:
> class AccountsWindow {
> 	[GtkWidget] Window accountsWindow;
> 	public AccountsWindow ()
> 	{
> 		Glade.XML gui =3D new Glade.XML (...);
> 		gui.AutoConnect (this);
> 	}
> }
Ok, So, the question is: When to derive from a Gtk.Object?.. When I'm
using a glade file or when Im coding 'on the fly'?.

> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt