On Tue, 16 Oct 2001, Brice VISSIERE wrote:
> Here are the warnings printed when i close the window
>
> Traceback (most recent call last):
> File "/usr/lib/python2.0/site-packages/gtk.py", line 125, in __call__
> ret = apply(self.func, a)
> TypeError: no arguments expected
>
> Other idea with these new elements ?
Brice, one thing I do know is that 'destroy' doesn't send an event as a
second parameter. So your callback function should have the following
signature:
def my_destroy_handler(self):
do_whatever()
return gtk.TRUE
You could also use something like
def my_destroy_handler(self, *args):
to avoid this sort of problem - I always do so my callbacks are easier to
use.
> There is a misunderstood, my callback function is not declared in the
> imported module, but in the main module; the window class definition is
> in the imported module. I try to do that : connect a callback to an
> instance of my window.
Note that 'delete_event' in turn _does_ supply an event parameter, so a
single-argument signature won't work for it. Use *args, and use
delete_event - it's safer :-)
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk