Re: how to destroy window if ptr to mainWindow not known



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lukasz Gromotowicz schrieb:
Hi all,

the problem is when loading windows from the xml file:

      glade_xml = glade_xml_new("ami.glade",NULL,NULL);

I need to know the reference to main window (GtkWindow) to be able to
destroy it, yes?
I can get it like this:
       window = glade_xml_get_widget(glade_xml,"window1");
and destroy:
      gtk_widget_destroy(window);
glade_xml_get_widget() returns NULL if the widget does not exists
you can check if "window" is not NULL and after that you can call
gtk_main or exit the app

But what if there is no "window1" in the glade file? Let's say updated xml
changed the name to "mainWindow"?

Window exists on the screen, but how to delete it?

I believe that in a old version of libglade, glade shows all toplevel
widgets even if gtk_widget_show_all was not called.
With a current version I never saw this again.

- --
Jens Sauer  <jens sauer ewetel net>
OpenPGP key D3CA3DAF
- -
to verify attachments
use 'gpg --verify FILENAME.sig FILENAME'
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHWDjnS6CQotPKPa8RAmPnAJ4i3RDmBG08WvNDVQHd6q82yg3G8QCfVfhD
F8A0Ci7njApZUj1bbpfAtd4=
=yk9l
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]