Re: Closing About GtkAboutDialog

From: Date: Mon, 29 Jan 2007 08:08:13 +0000
Subject: Re: Closing About GtkAboutDialog
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7609@lists.php.net to get a copy of this message
delete-event... ----- Original Message ----- From: "Benjamin Smith" <lists@benjamindsmith.com> To: <php-gtk-general@lists.php.net> Sent: Monday, January 29, 2007 7:12 AM Subject: Re: [PHP-GTK] Closing About GtkAboutDialog
Dunno about glade, but I think the signal you want to trap is called "destroy". I routinely trap these to force behavior other than "die". Look in GtkWidget or one of the more basic classes. Cheers! -Ben On Sunday 28 January 2007 08:08, Lupine wrote:
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 -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
-- "The best way to predict the future is to invent it." - XEROX PARC slogan, circa 1978 -- PHP-GTK General Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.gtk.general (#7609) next »