Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-09-12 07:33:53 (GMT)
committer Daniel Drake <dsd@laptop.org>2011-09-12 07:35:05 (GMT)
commit4c9791c5b10c0185f30ca9b94aba11d73ae53804 (patch)
tree52ff3a41fbd5c7c2187feaf26b66c8bcd09b9de5
parent6bbc29facb6dd4002d5e4827d54dbcab6225b309 (diff)
CanvasIcon: activated signal needed after all
This should be used instead of button-press-event where right vs left click matters
-rw-r--r--src/sugar/graphics/icon.py10
1 files changed, 10 insertions, 0 deletions
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