Re: how do I close the dialog and at the same time run a subroutine in the background
- From: Juhász Péter <peter juhasz83 gmail com>
- To: lointaineimage <lointaineimage gmail com>, gtk-perl-list gnome org
- Subject: Re: how do I close the dialog and at the same time run a subroutine in the background
- Date: Sat, 05 Dec 2009 11:59:39 +0100
On Fri, 2009-12-04 at 20:29 +0800, lointaineimage wrote:
I want to destroy the dialog and call a subroutine when I click the
"yes" button,here is part of my code ,but it doesn't work well,the
dialog is closed until the subroutine is finished.waiting for your
help,thanks!
here is part of my code:
#=========================================
my $dialog =Gtk2::MessageDialog->new
($window,'destroy-with-parent','something to confirm','yes-no',");
my $response = $dialog->run;
if($response eq "yes"){
$dialog->destroy;
&mysubroutine;
}
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
I think this would do the trick:
#...
$dialog->destroy;
Gtk2->main_iteration() while Gtk2->events_pending(); # Inserted line
&mysubroutine;
#...
PÃter JuhÃsz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]