Le mer 30/07/2003 à 19:27, Dusausoy Bruno a écrit :
> Hi,
>
> I'm quite new to pygtk and I have a problem. I've connected the
> "clicked" signal to a button and it should normally call
> exit_window.destroy() function. But Python gives me this error:
>
> TypeError: destroy() takes no arguments (1 given)
>
> with this code :
Really sorry, i pressed the wrong button :)
Here's the code :
button = gtk.Button("Cancel", gtk.STOCK_CANCEL)
button.connect("clicked", exit_window.destroy)
exit_window.action_area.pack_start(button, gtk.FALSE, gtk.FALSE,
0)
button.show()
I've searched on google and found a mail sent to this mailing list :
"Manish Jethani manish.jethani at oracle.com
Fri May 9 07:26:56 WST 2003
<snip>
To fix this, I changed it to:
self.button.connect("clicked",
lambda x: self.window.destroy())
connect_object has been replaced with connect. This works fine
i.e. calls destroy() successfully. Does this look ok?"
Is there another way ? I mean, something more clean ?
Thanks.
--
Dusausoy Bruno <[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/