diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-02-21 11:02:57 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-02-21 11:02:57 (GMT) |
commit | abff0a8cecb5b16c7c6f4a21cd3e4d8d8023ccab (patch) | |
tree | 629ffb1d1b6364dde092485dfe3b00e33141c7c8 | |
parent | 111da5911a82378e00839580f2877394d86a8114 (diff) |
Throw NotImplementedError in abstract method.
-rw-r--r-- | sugar/graphics/button.py | 7 | ||||
-rw-r--r-- | sugar/graphics/popupcontext.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sugar/graphics/button.py b/sugar/graphics/button.py index ea4df95..28c9f59 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 59fb16b..99498e9 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 |