[Gtk-sharp-list] Extending Gtk.Window

Leo Spalteholz leo@thewoodpecker.ca
Thu, 20 Nov 2003 18:39:40 -0800

On November 20, 2003 02:10 pm, Pablo Fischer wrote:
> Hi!
> 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;
> right?.
> If yes, I'm sorry to upload the file with that error, It should not have
> 'this =3D accountsWindow'.
> > 	* 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
> this.Visible?

ITheres nothing wrong with using "this" to reference the object methods=20
(although unnecessary unless the member is hidden by a local variable). =20
You just shouldn't assign anything to "this" directly.
this.Visible =3D true;
is alright but
this =3D mynewwindow;
is no good.