Re: [pygtk] More info on previous question: Unknown widget class: GnomeApp
Be sure you installed the pygnome-libglade package. Matt On Mon, Jun 05, 2000 at 12:42:38AM -0700, Mike Payson wrote: I haven't recieved a response to my previous question, so I thought a bit more info might help... After executing the libglade tutorial at http://www.baypiggies.org/10mintig.html, I'm getting an error "unknown widget class 'GnomeApp'". The trace back I'm getting is: ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] More info on previous question: Unknown widget class: GnomeApp
Matt Wilson wrote: Be sure you installed the pygnome-libglade package. Thanks... That was the problem. Mike Matt On Mon, Jun 05, 2000 at 12:42:38AM -0700, Mike Payson wrote: I haven't recieved a response to my previous question, so I thought a bit more info might help... After executing the libglade tutorial at http://www.baypiggies.org/10mintig.html, I'm getting an error "unknown widget class 'GnomeApp'". The trace back I'm getting is: ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
[pygtk] Signal handling
I have a problem trying to install a new signal handler. I try this program: #!/usr/bin/env python from signal import * from gtk import * def signal_handler(sig, frame): print "Received signal %s" % (sig) signal(10, signal_handler) win = GtkWindow() win.set_usize(100,100) win.show() win.connect("destroy", mainquit) mainloop() but if I write: $ kill -s 10 pid the program answer only after the mainquit. If I don't import gtk and I write a simple console application it works. And the same program translate in C works. Someone can help me? Thanks. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Signal handling
"Luca Minuti" [EMAIL PROTECTED] writes: #!/usr/bin/env python from signal import * from gtk import * def signal_handler(sig, frame): print "Received signal %s" % (sig) signal(10, signal_handler) win = GtkWindow() win.set_usize(100,100) win.show() win.connect("destroy", mainquit) mainloop() but if I write: $ kill -s 10 pid the program answer only after the mainquit. I've hit this problem before[1], and it boiled down to a problem with Gtk/Python interaction. You should know that in Python signals are never really asynchronous. When the OS/C-level signal handler is invoked, Python merely enqueues the Python handler to a special queue, to be executed by the Python interpreter as soon as possible. The problem with Gtk is that when the signal handler returns, it gives back control to the Gtk main loop, not to Python, so the code that is supposed to check for the signal-handler queue gets run only when the interpreter exits. The solution here is for pygtk to hook into the main loop with a routine that gets run after the loop has been interrupted by a signal. This routine would manually call the Python signal-handling incantation. Alas, last time I looked, GDK main loop didn't have that kind of hook. I asked about it on the Gtk list, but got no response. James, have you looked into the features of GDK main loop recently? Can you now specify a "post-signal" handler nowadays? [1] Before someone jumps with "don't use UNIX signals in a GUI application", let me assure you that it was hard to do otherwise. My Gtk program spawned off a bunch of child processes, and was interested in their exit statuses. Apparently the only wait to find out when a process has died is to handle SIGCHLD. I haven't found the solution to the problem, and gave up the application entirely. ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Signal handling
On Mon, Jun 05, 2000 at 03:17:02PM +0200, Luca Minuti wrote: My program must do this: if someone make some change to the data that the program manipulate other instance of the same program must update their own view. Have your program set up a named pipe and add an input hander on that file descriptor. When other programs want your program to update its view, write to the pipe. Just an idea. Matt ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk
Re: [pygtk] Signal handling
"Luca Minuti" [EMAIL PROTECTED] writes: I think that the use of the signal is not the only possible solution for me. But I don't know others inter process comunication tecnique. My program must do this: if someone make some change to the data that the program manipulate other instance of the same program must update their own view. How do you know the PID's of the other instances? ___ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk