|No such thing as a small change|
Perl Gtk2 - ->destroy() is Not Causing the Script to Exitby mmartin (Monk)
|on May 02, 2014 at 18:41 UTC||Need Help??|
mmartin has asked for the
wisdom of the Perl Monks concerning the following question:
Perl: Strawberry Perl 5.18 (*on Windows XP)
A few months ago I wrote a very large GUI program using Perl Gtk2 which still seems to be working just fine. But I'm now
creating a MUCH smaller GUI script that I really just want to display a Popup window to ask the User Yes Or No. If they select
"No" then the script SHOULD exit. I don't remember ever having this issue in my last GUI program, but it was a while ago now and
I'm pretty confused by this error, and why the script won't exit.
Here is my Gtk2 code. At first I just created a MessageDialog object with 'undef' as its parent but I was getting errors. The error
wasn't specifically towards the parent window, but I decided to create a $window object (*toplevel) anyway and I just don't ever
issue the "->show_all" function to display it...
So when I execute the script, the MessageDialog opens just fine and I click the "No" button and I get the following error:
Gtk-CRITICAL **: gtk_main_quit: assertion `main_loops != NULL' failed at C:\Documents and Settings\Administrator\My Documents \test_gtk.pl line 10.
Also, when the error gets displayed in the console window, the script basically just hangs until I do a Ctrl-C...
Anyone have any idea why this isn't working, am I missing something here?
Any thoughts or suggestions would be much appreciated, I'm not sure what else to try.
Thanks in Advance,