Re: executing gtk::main_quit ();
| From: | Richard Lynch | Date: | Mon, 09 May 2005 06:59:05 +0000 |
| Subject: | Re: executing gtk::main_quit (); | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5832@lists.php.net to get a copy of this message | ||
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.
As I understand it, the root problem is this:
His automated error handling is creating GtkMessageDialog, and then
calling gtk::main_quit() when the user clicks "Close" on that, because he
wants to quit out of his application after an error.
But sometimes the error that causes all this to happen is occuring
*before* the end of the script wherein the last object is created, and
gtk::main() is called.
So the gtk::main_quit() gets called due to an error condition that
pre-dates the gtk::main() call.
The short answer is "Don't do that"
The longer answer is, maybe there is a function you can call to find out
if you are in a gtk::main() loop.
Another alternative is to have a global variable that you set right before
gtk::main() and check before you try to gtk::main_quit()
Also, to answer an earlier question you had buried in there:
I am reasonably certain that if you just call die() everything will be
hunky-dory whether you called gtk::main_quit() or not already.
die() will kill of the whole kit and kaboodle, unless you've *really*
fargled memory up to the point where only an external signal (kill -9)
will kill it.
In which case gtk::main_quit() sure ain't gonna be better than die()
anyway, almost for sure.
Apologies in advance if I've mis-understood the problem or over-simplified
something, or if my rudimentary GTK knowledge is misleading down a garden
path.
--
Like Music?
http://l-i-e.com/artists.htm