From 4c9791c5b10c0185f30ca9b94aba11d73ae53804 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Mon, 12 Sep 2011 07:33:53 +0000 Subject: CanvasIcon: activated signal needed after all This should be used instead of button-press-event where right vs left click matters --- diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py index f4b125f..20c52ef 100644 --- a/src/sugar/graphics/icon.py +++ b/src/sugar/graphics/icon.py @@ -556,6 +556,9 @@ class Icon(gtk.Image): class CanvasIcon(gtk.EventBox): __gtype_name__ = 'CanvasIcon' + __gsignals__ = { + 'activated': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, []), + } def __init__(self, **kwargs): from sugar.graphics.palette import CanvasInvoker @@ -910,6 +913,13 @@ class CanvasIcon(gtk.EventBox): req.width = 0 req.height = 0 + def do_button_press_event(self, event): + if event.button == 1: + self.emit('activated') + return True + else: + return False + def create_palette(self): return None -- cgit v0.9.1