Re: blocking code after main loop



On 10/9/06, Michael Hartmann <michael hartmann as-netz de> wrote:

my $window = Gtk2::Window->new;
$window->signal_connect("delete-event" => sub { Gtk2->main_quit; 0;});

my $button = Gtk2::Button->new("Close me");
$button->signal_connect(clicked => sub { Gtk2->main_quit; } );


Why is the gui still available when perl runs sleep?
And related to this question: How can I avoid this problem?

Hide the window before quitting the gtk main loop:

$button->signal_connect(clicked => sub { $window->hide; Gtk2->main_quit; } );


jens

--
Jens Luedicke
web: http://perldude.de/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]