Closing About GtkAboutDialog
| From: | Lupine | Date: | Sun, 28 Jan 2007 16:08:55 +0000 |
| Subject: | Closing About GtkAboutDialog | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-7597@lists.php.net to get a copy of this message | ||
Forgive me if this has been asked before, I Googled the archives, and
didn't find it. If it has, please accept my apologies, and just point
me in the right direction.
I just started playing around with PHP-GTK Glade based applications, and
I've come up against a fairly simple, but so far escaping problem.
Let's say I created a very simple Glade file with 2 dialogs. The
main_dialog and the about_dialog. If I code up something to display the
about_dialog when the users clicks the Help -> About:
...
$this->glade->get_widget("about_dialog")->show();
...
And then the user uses the built in little "X" at the top right to close
the about_dialog or hits ALT+F4 to close the about_dialog, everything is
fine. However, if the user tries to re-open the about_dialog, they'll
get an error like this:
Fatal error: Call to a member function show() on a non-object in...
Which makes sense, because the object has been destroyed, not hidden.
If the user clicks my close button, which I have coded to do this:
function on_about_close_button_clicked()
{
$this->glade->get_widget("about_dialog")->hide();
}
...then everything works, and the user can re-launch the about_dialog as
needed. However, if they close the dialog with any other method than
the Close button, the error will always happen.
With using Glade + PHP-GTK, what is the best way around this?
-Lup