Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-16 11:20:03 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-16 11:20:03 (GMT)
commit8a88de864b84d3cc798412c65712edb2e8271527 (patch)
tree7f23bdb47a34ecea62ba606a1463bc94af1e247a /sugar
parente8a21bf6a03dd70524ada386a105f8260e994a15 (diff)
Fix tooltip popup.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/canvasicon.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py
index 23ac60d..6108ece 100644
--- a/sugar/graphics/canvasicon.py
+++ b/sugar/graphics/canvasicon.py
@@ -355,16 +355,17 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
return None
def show_popup(self):
- popup = self.get_popup()
- if not popup:
- return
+ if not self._popup:
+ self._popup = self.get_popup()
+ if not self._popup:
+ return
popup_context = self.get_popup_context()
[x, y] = [None, None]
if popup_context:
try:
- [x, y] = popup_context.get_position(self, popup)
+ [x, y] = popup_context.get_position(self, self._popup)
except NotImplementedError:
pass
@@ -374,23 +375,21 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
# TODO: Any better place to do this?
[min_width, natural_width] = self.get_width_request()
- [pop_min_width, pop_natural_width] = popup.get_width_request()
- popup.props.box_width = max(pop_min_width, min_width)
+ [pop_min_width, pop_natural_width] = self._popup.get_width_request()
+ self._popup.props.box_width = max(pop_min_width, min_width)
[width, height] = self.get_allocation()
y += height
position = [x, y]
- popup.popup(x, y)
- popup.connect('motion-notify-event',
- self.popup_motion_notify_event_cb)
- popup.connect('action-completed',
- self._popup_action_completed_cb)
+ self._popup.popup(x, y)
+ self._popup.connect('motion-notify-event',
+ self.popup_motion_notify_event_cb)
+ self._popup.connect('action-completed',
+ self._popup_action_completed_cb)
if popup_context:
- popup_context.popped_up(popup)
-
- self._popup = popup
+ popup_context.popped_up(self._popup)
def hide_popup(self):
if self._popup: