Re: executing gtk::main_quit ();

From: Date: Mon, 09 May 2005 14:41:33 +0000
Subject: Re: executing gtk::main_quit ();
References: 1 2 3  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5835@lists.php.net to get a copy of this message
Op Monday 09 May 2005 14:41, schreef u: > Op Monday 09 May 2005 13:33, schreef Tom Rogers: > > Hi, > > > > Monday, May 9, 2005, 4:59:05 PM, you wrote: > > > > RL> On Sat, May 7, 2005 2:11 pm, Andrei Zmievski said: > > >> On Apr 30, 2005, at 11:30 AM, Sander Knopper wrote: > > >>> At the end of the script a new object is made and gtk::main (); is > > >>> called. > > >>> > > >>> Anyway, the problem is that when an error occurs and I generate a > > >>> GtkMessageDialog > > >> > > >> How are you generating it exactly? Please, provide code. > > > > RL> As I understand it, the root problem is this: > > > > RL> His automated error handling is creating GtkMessageDialog, and then > > RL> calling gtk::main_quit() when the user clicks "Close" on that, > > because he RL> wants to quit out of his application after an error. > > > > RL> But sometimes the error that causes all this to happen is occuring > > RL> *before* the end of the script wherein the last object is created, > > and RL> gtk::main() is called. > > > > RL> So the gtk::main_quit() gets called due to an error condition that > > RL> pre-dates the gtk::main() call. > > > > RL> The short answer is "Don't do that" > > > > RL> The longer answer is, maybe there is a function you can call to find > > out RL> if you are in a gtk::main() loop. > > > > gtk::main_level() may be of help.. > > > > -- > > regards, > > Tom > > Thanks for noticing, I already found the function in the gtk docs but I > forgot to mention it. Thanks! > > Sander Hi all, The problem is solved, I just connected the destroy signal with the destroy function of the main window instead of gtk::main_quit () and everything works correctly now. Sander

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