From d4639a1764b0a846b3821366f2c4fb4fa409021d Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 21 Feb 2007 20:29:08 +0000 Subject: Use hippo.CanvasContext.translate_to_screen() for positioning popups. --- (limited to 'sugar/graphics') diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py index 020e966..fb4974a 100644 --- a/sugar/graphics/canvasicon.py +++ b/sugar/graphics/canvasicon.py @@ -296,8 +296,7 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem): if [x, y] == [None, None]: context = self.get_context() - #[x, y] = context.translate_to_screen(self) - [x, y] = context.translate_to_widget(self) + [x, y] = context.translate_to_screen(self) # TODO: Any better place to do this? popup.props.box_width = max(popup.props.box_width, diff --git a/sugar/graphics/optionmenu.py b/sugar/graphics/optionmenu.py index 2e6e456..f2e4603 100644 --- a/sugar/graphics/optionmenu.py +++ b/sugar/graphics/optionmenu.py @@ -150,8 +150,7 @@ class OptionMenu(hippo.CanvasBox, hippo.CanvasItem): self._menu.hide() else: context = self._round_box.get_context() - #[x, y] = context.translate_to_screen(self._round_box) - [x, y] = context.translate_to_widget(self._round_box) + [x, y] = context.translate_to_screen(self._round_box) # TODO: Any better place to do this? self._menu.props.box_width = self.get_width_request() -- cgit v0.9.1