diff --git a/sugar/graphics/button.py b/sugar/graphics/button.py index ea4df95c..28c9f59c 100644 --- a/sugar/graphics/button.py +++ b/sugar/graphics/button.py @@ -89,9 +89,12 @@ class Button(hippo.CanvasBox): [x, y] = [None, None] if popup_context: - [x, y] = popup_context.get_position(self._icon, popup) + try: + [x, y] = popup_context.get_position(self._icon, popup) + except NotImplementedError: + pass - if (not x) or (not y): + if [x, y] == [None, None]: context = self._icon.get_context() #[x, y] = context.translate_to_screen(self._icon) [x, y] = context.translate_to_widget(self._icon) diff --git a/sugar/graphics/popupcontext.py b/sugar/graphics/popupcontext.py index 59fb16bb..99498e93 100644 --- a/sugar/graphics/popupcontext.py +++ b/sugar/graphics/popupcontext.py @@ -44,4 +44,4 @@ class PopupContext(gobject.GObject): return self._active_control != None def get_position(self, control, popup): - return [None, None] + raise NotImplementedError