Use hippo.CanvasContext.translate_to_screen() for positioning popups.

This commit is contained in:
Tomeu Vizoso 2007-02-21 21:29:08 +01:00
parent c9af045e43
commit d4639a1764
2 changed files with 2 additions and 4 deletions

View File

@ -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,

View File

@ -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()