From: Javier G. <god...@gm...> - 2005-10-19 17:24:13
|
Hello, I have a noobee question, I was unable to find a more appropriate list to post this, please redirect me is this question is inappropriate. I am not sure how to get out of a running thread from a Gtk2 callback, here is the code: ############################# #!/usr/bin/perl -w use Gtk2 '-init'; use strict; use threads; my $keep_running =3D 1; my $thr1 =3D threads->new(sub { =09while ($keep_running =3D=3D 1 ) { =09=09print "Hello\n"; =09=09sleep(1); =09} }); sub button_callback { =09$keep_running =3D 0; =09t$thr1->join; =09Gtk2->main_quit; } my $window =3D Gtk2::Window->new; my $button =3D Gtk2::Button->new ("Quit!"); $button->signal_connect (clicked =3D> \&button_callback); $window->add($button); $window-> show_all; Gtk2->main; ############################# Is there a way to gracefully stop the thread from a callback? Thanks, Javier Godinez |
From: Torsten S. <kaf...@we...> - 2005-10-19 18:00:45
|
On Wed, 2005-10-19 at 10:24 -0700, Javier Godinez wrote: > I have a noobee question, I was unable to find a more appropriate list > to post this, please redirect me is this question is inappropriate. The gtk2-perl-bugs list is only for Bugzilla-related mails. The real mailing list is gtk...@gn...: http://mail.gnome.org/mailman/listinfo/gtk-perl-list Ask your question there. -- Bye, -Torsten |
From: muppet <sc...@as...> - 2005-10-19 18:13:11
|
Javier Godinez said: > I have a noobee question, I was unable to find a more appropriate list > to post this, please redirect me is this question is inappropriate. This is a bugs-only list. Please re-post over on the general list: gtk...@gn... http://mail.gnome.org/mailman/listinfo/gtk-perl-list -- muppet <scott at asofyet dot org> |