open/fork from a callback hang the windows (gtk2::helper)
- From: Prunk Dump <prunkdump gmail com>
- To: gtk-perl-list gnome org
- Subject: open/fork from a callback hang the windows (gtk2::helper)
- Date: Thu, 15 Jan 2015 07:21:25 +0100
Hello gtk-perl team !
I try to make a program that launch a command when a button is pressed
and monitor his output with some progress bars. I have found that
there are a Gtk2::helper->add_watch method for doing this.
But if I fork the command with "open" in a callback, the gtkmain
thread hangs until the command finish. I'm sure that the open call is
non-blocking.
sub my_callback {
my $fd = FileHandle->new()
open($fd, "mycommand | ") or quitCallback("can't fork")
}
--> hang on return
I don't really understand why. Maybe Gtk make the callbacks with new
threads and wait the result with waitpid ?
On all gtk2::helper examples I've found, the "open" call is made
before Gtk2->main. How can I do if the windows is already displayed
and if I'm inside gtkmain ?
Thanks !
Baptiste.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]