Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-11-26 12:56:28 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-11-26 12:56:28 (GMT)
commite8246106a4db5e226182828d43ebede7847988a7 (patch)
tree85cf6c70f30455ec7bc5784cce39ed811d53fd01 /lib
parent6bb1131e9db0cf924de221558abc6b4840ac83e1 (diff)
Fixed traceback, see #4515
Diffstat (limited to 'lib')
-rw-r--r--lib/sugar/graphics/palette.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/sugar/graphics/palette.py b/lib/sugar/graphics/palette.py
index 9f77fee..acb687e 100644
--- a/lib/sugar/graphics/palette.py
+++ b/lib/sugar/graphics/palette.py
@@ -686,12 +686,19 @@ class WidgetInvoker(Invoker):
widget.connect('leave-notify-event', self._leave_notify_event_cb)
def get_rect(self):
- x, y = self._widget.window.get_origin()
allocation = self._widget.get_allocation()
+ if self._widget.window is not None:
+ x, y = self._widget.window.get_origin()
+ else:
+ logging.warning(
+ "Trying to position palette with invoker that's not realized.")
+ x = 0
+ y = 0
if self._widget.flags() & gtk.NO_WINDOW:
- x += allocation.x
- y += allocation.y
+ x += allocation.x
+ y += allocation.y
+
width = allocation.width
height = allocation.height