On Tue, 2004-11-23 at 20:51 +0100, Martijn Brouwer wrote:
> I do not succeed in using the "show" signal. To isolate my problem I
> have written this "Hello World" program:
> 
> import gtk
> import gtk.glade
> 
> def HelloWorld(widget):
>       print "Hello World!"
> 
> dic={"on_window1_show": HelloWorld}
> Widgets=gtk.glade.XML("onshow.glade", "window1")
> Widgets.signal_autoconnect(dic)
> 
> gtk.main()
> 
> In my glade file I have connected the "show" signal of the mainwindow to
> the on_window1_show handler.
> When I run this program, the window (which only shows a label) is showed
> correctly, but the HelloWorld function is not called.
> Where is my mistake?

  You are connecting the signal _after_ it being emitted.   Try setting
the 'visibile' property of window to false, in glade.  Then, in the
code, connect your signal and then manually show the window, with
Widgets.get_widget("window1").show().  Your callback will then be
invoked.

> 
> Thanks in advance for helping,
> 
> Martijn Brouwer
> 
> 
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to