[pygtk] How can I inherit __gsignals__ attribute from a class?
Iven Day
ivenvd at gmail.com
Mon Jun 1 23:52:59 WST 2009
Hi,
I wrote a parent class like this:
class PluginObject(gobject.GObject):
__gsignals__ = {
"change-ui": (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
(gobject.TYPE_PYOBJECT, gobject.TYPE_STRING,)),
}
def __init__(self):
gobject.GObject.__init__(self)
, and a child class like this:
class PluginComboBox(gtk.ComboBox, PluginObject):
def __init__(self, input_dict):
PluginObject.__init__(self)
gtk.ComboBox.__init__(self)
...
self.connect("changed", self.changed_cb, input_dict)
self.set_active(0)
def changed_cb(self, widget, data = None):
model = self.get_model()
index = self.get_active()
self.emit("change-ui", data.values, data[model[index][0]])
, but I got a
TypeError: <PluginComboBox object at 0x7f02c4c20690 (GtkComboBox at
0x26e8010)>: unknown signal name: change-ui
It seems __gsignals__ isn't inherited, how can I get it work?
Sorry for my english.
More information about the pygtk
mailing list