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



I do check glade_xml_new() and all glade_xml_get_widget()  for NULL return.
Problem is that the gtk_main() is already running as I create new windows in
events / callbacks from the existing window. All I would like to do is not
to create and not to show the new window if there are any problems.

regards,
LUK


2007/12/6, Jens Sauer <jens sauer ewetel net>:

-----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-----

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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