Here is a short version without kiwi
requirement.
class CellRendererClickablePixbuf(gtk.CellRendererPixbuf):
__gsignals__ = {'clicked': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE,
(gobject.TYPE_STRING,))
}
def __init__(self):
gtk.CellRendererPixbuf.__init__(self)
self.set_property('mode', gtk.CELL_RENDERER_MODE_ACTIVATABLE)
def do_activate(self, event, widget, path, background_area, cell_area,
flags):
self.emit('clicked', path)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…