[Gtk-sharp-list] Opening / Closing Windows

Pablo Fischer pablo@pablo.com.mx
Mon, 08 Dec 2003 23:24:19 -0600


Hi Matthew!

I do this: I create a class for every window (well not for dialogs), so
for example, for 'informationwindow':

public bool IsOpen() {
      return accountsWindow.Visible;
    }

And how I destroy/close it?, for example:

    private void  on_closeaccounts_button_clicked(System.Object obj,
EventArgs e) {
      accountsWindow.Hide();
    }

And the same for the DeleteEvent (the X).

But How can I know if there's an open window?, with this in the class
that I create that oobject (informationwindow).


if(pw =3D=3D null) {
          pw =3D new PostsWindow(this, client);
          pw.showWindow();
        }
        else {
          if(!pw.IsOpen()) {
            pw.reloadClient(client);
            pw.showWindow();
          }
        }

The first think I do is to check if the object is null, if it's null,
then I create the object and then show it. But what if isn't?, So I
check if I have tha tiwndow already open, if is NOT open I reload data
(in my case) and show it. If is open, do nothing..

See ya!
Pablo
El lun, 08-12-2003 a las 19:04, Met @ Uber escribi=F3:
> Within a glade file I have a Window widget which I don't want opened
> until a specific event.  Upon that event I want to show it (.Show()
> presumably) and then on closing the window by hitting the X or by
> clicking "Close" I would like to destroy it.  Since this is an applet,
> I'm guessing for memory purposes its better to create the Window and
> then destroy it again?
>=20
> Simply put, what would be the best method to open/create and then
> close/destroy a window which is part of an Applet (something that is
> long running) and defined via a Glade XML file?
>=20
> Thanks in advance,
>=20
> ~ Matthew
>=20
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
--=20
Pablo Fischer Sandoval (pablo [arroba/at] pablo.com.mx)
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt