[pygtk] Multiple inheritance from gobject.GObject classes
Zsolt Foldvari
zsolt.foldvari at nokia.com
Thu Mar 29 21:15:11 WST 2007
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
More information about the pygtk
mailing list