Hi All,

At this stage (pygobject 2.12), is multiple inheritance from gobject.GObject
subclasses (each with their own gsinals and gproperties) supposed to work?
If yes, I guess I'm doing something wrong, because my final subclass only
inherits the signals and properties from the first parent class on the list.

=============================================================================

class BaseClass(gobject.GObject):

    __gtype_name__ = 'BaseClass'

    __gsignals__ = {
        'base-signal': (gobject.SIGNAL_RUN_FIRST,
                        gobject.TYPE_NONE,
                        ()),
    }

    __gproperties__ = {
        'base-prop': (gobject.TYPE_INT,
                      'Base',
                      'Base',
                      0,
                      10,
                      0,
                      gobject.PARAM_READWRITE),
    }

    def __init__(self):
        gobject.GObject.__init__(self)
        <-clip->

    def do_get_property(self, prop):
        <-clip->

    def do_set_property(self, prop, value):
        <-clip->

class Mixin(gobject.GObject):

    __gtype_name__ = 'Mixin'

    __gsignals__ = {
        'mixin-signal': (gobject.SIGNAL_RUN_FIRST,
                         gobject.TYPE_NONE,
                         ()),
    }

    __gproperties__ = {
        'mixin-prop': (gobject.TYPE_STRING,
                       'Mixin',
                       'Mixin',
                       "empty",
                       gobject.PARAM_READWRITE),
    }

    def __init__(self):
        gobject.GObject.__init__(self)
        <-clip->

    def do_get_property(self, prop):
        <-clip->

    def do_set_property(self, prop, value):
        <-clip->

class SubClass(BaseClass, Mixin):

    __gtype_name__ = 'SubClass'

    __gsignals__ = {
        'sub-signal': (gobject.SIGNAL_RUN_FIRST,
                       gobject.TYPE_NONE,
                       ()),
    }

    __gproperties__ = {
        'sub-prop': (gobject.TYPE_STRING,
                     'Sub',
                     'Sub',
                     "empty",
                     gobject.PARAM_READWRITE),
    }

    def __init__(self):
        BaseClass.__init__(self)
        Mixin.__init__(self)
        <-clip->

    def do_get_property(self, prop):
        <-clip->

    def do_set_property(self, prop, value):
        <-clip->
=============================================================================

Any hint is appreciated.

Regards,
Zsolt Foldvari
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to