Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-06-06 14:24:49 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-06-06 14:24:49 (GMT)
commitb1dfd17014d459ef2a2d525f9d457dadb9d43dc8 (patch)
tree057d8db9058c75ce92c6a7c20ee324c0e6bd4da9
parentad195be2bfc92ce1c9c8a08b6935633396712c95 (diff)
Add activate signal to CellRendererIcon
-rw-r--r--src/sugar/graphics/icon.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index 7bbeea5..5d47fc5 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -922,6 +922,10 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
class CellRendererIcon(gtk.CellRendererPixbuf):
__gtype_name__ = 'SugarCellRendererIcon'
+ __gsignals__ = {
+ 'activate': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, [object])
+ }
+
def __init__(self):
gobject.GObject.__init__(self)
self._buffer = _IconBuffer()
@@ -983,6 +987,9 @@ class CellRendererIcon(gtk.CellRendererPixbuf):
gtk.CellRendererPixbuf.do_render(self, window, widget, background_area, cell_area, expose_area, flags)
+ def do_activate(self, event, widget, path, background_area, cell_area, flags):
+ self.emit('activate', path)
+
def get_icon_state(base_name, perc, step=5):
strength = round(perc / step) * step
icon_theme = gtk.icon_theme_get_default()