[prev in list] [next in list] [prev in thread] [next in thread]
List: gtk-app-devel
Subject: Re: how to destroy window if ptr to mainWindow not known
From: Jens Sauer <jens.sauer () ewetel ! net>
Date: 2007-12-06 18:01:17
Message-ID: 475838ED.9010206 () ewetel ! net
[Download RAW message or body]
-----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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic