On Sun, Oct 31, 2004 at 06:28:20PM -0700, Robert Uhl wrote:
> I'm trying to subclass GnomeCanvas and defined my own signal, but for
> some my new signal is unrecognised. This is (a reduced version of) my
> code:
>
> import pygtk
> pygtk.require('2.0')
> import gobject, gnome, gnome.canvas, gtk
>
> class SystemCanvas(gnome.canvas.Canvas):
> __gsignals__ = {
> 'changed2' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
> (gobject.TYPE_STRING,)),
> }
> def __init__(self, aa=gtk.TRUE):
> gnome.canvas.Canvas.__init__(self, aa=aa)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think this is your problem. According to Lorenzo's tutorial at::
http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html#d0e530
you can't call the superclass's constructor from __init__(). Instead you
need to use self.__gobject_init__() and then set the properties via methods
later in __init__().
-Toshio
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/