Did you set window1 invisible in your glade file?
On Tue, 23 Nov 2004 23:19:24 +0100, Martijn Brouwer
<[EMAIL PROTECTED]> wrote:
> On Tue, 2004-11-23 at 21:20 +0000, Gustavo J. A. M. Carneiro wrote:
> > On Tue, 2004-11-23 at 20:51 +0100, Martijn Brouwer wrote:
> > 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 for your fast answer. Your suggestion works partially. I changed
> my test program to what is shown below.
> import gtk
> import gtk.glade
> import time
>
> def HelloWorld(widget):
> print "Hello World!"
>
> dic={"on_window1_show": HelloWorld}
> Widgets=gtk.glade.XML("onshow.glade", "window1")
> Widgets.signal_autoconnect(dic)
>
> print "show the window"
> Widgets.get_widget("window1").show()
> time.sleep(1)
> print "hide the window"
> Widgets.get_widget("window1").hide()
> time.sleep(1)
> print "show it again"
> Widgets.get_widget("window1").show()
> gtk.main()
>
> When I run this program, the output on the console is:
> show the window
> hide the window
> show it again
> Hello World!
>
> The program window only appears after the *second* invocation of show(),
> just as "Hello World!" is only printed the second time. Apperently, the
> connection of the signal works. By why is nothing happening on the first
> invocation?
>
> Bye,
>
> Martijn
>
>
>
>
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
--
Christopher Lambacher
[EMAIL PROTECTED]
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/