From b087809ec5568bc62da06be66882e853b8898d90 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 10 Sep 2009 09:46:37 +0000 Subject: focus the canvas make the boxes private using the python mangling algorithm (see pep8) --- diff --git a/src/sugar/graphics/window.py b/src/sugar/graphics/window.py index 9cba30e..48adda0 100644 --- a/src/sugar/graphics/window.py +++ b/src/sugar/graphics/window.py @@ -96,20 +96,20 @@ class Window(gtk.Window): self._canvas = None self.tray = None - self._vbox = gtk.VBox() - self._hbox = gtk.HBox() - self._vbox.pack_start(self._hbox) - self._hbox.show() + self.__vbox = gtk.VBox() + self.__hbox = gtk.HBox() + self.__vbox.pack_start(self.__hbox) + self.__hbox.show() self._event_box = gtk.EventBox() - self._hbox.pack_start(self._event_box) + self.__hbox.pack_start(self._event_box) self._event_box.show() self._event_box.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.POINTER_MOTION_MASK) self._event_box.connect('motion-notify-event', self.__motion_notify_cb) - self.add(self._vbox) - self._vbox.show() + self.add(self.__vbox) + self.__vbox.show() self._is_fullscreen = False self._unfullscreen_button = UnfullscreenButton() @@ -126,6 +126,7 @@ class Window(gtk.Window): self._event_box.add(canvas) self._canvas = canvas + self.__vbox.set_focus_child(self._canvas) def get_canvas(self): return self._canvas @@ -137,10 +138,10 @@ class Window(gtk.Window): def set_toolbar_box(self, toolbar_box): if self._toolbar_box: - self._vbox.remove(self._toolbar_box) + self.__vbox.remove(self._toolbar_box) - self._vbox.pack_start(toolbar_box, False) - self._vbox.reorder_child(toolbar_box, 0) + self.__vbox.pack_start(toolbar_box, False) + self.__vbox.reorder_child(toolbar_box, 0) self._toolbar_box = toolbar_box @@ -152,35 +153,35 @@ class Window(gtk.Window): box.remove(self.tray) if position == gtk.POS_LEFT: - self._hbox.pack_start(tray, False) + self.__hbox.pack_start(tray, False) elif position == gtk.POS_RIGHT: - self._hbox.pack_end(tray, False) + self.__hbox.pack_end(tray, False) elif position == gtk.POS_BOTTOM: - self._vbox.pack_end(tray, False) + self.__vbox.pack_end(tray, False) self.tray = tray def add_alert(self, alert): self._alerts.append(alert) if len(self._alerts) == 1: - self._vbox.pack_start(alert, False) + self.__vbox.pack_start(alert, False) if self._toolbar_box is not None: - self._vbox.reorder_child(alert, 1) + self.__vbox.reorder_child(alert, 1) else: - self._vbox.reorder_child(alert, 0) + self.__vbox.reorder_child(alert, 0) def remove_alert(self, alert): if alert in self._alerts: self._alerts.remove(alert) # if the alert is the visible one on top of the queue if alert.get_parent() is not None: - self._vbox.remove(alert) + self.__vbox.remove(alert) if len(self._alerts) >= 1: - self._vbox.pack_start(self._alerts[0], False) + self.__vbox.pack_start(self._alerts[0], False) if self._toolbar_box is not None: - self._vbox.reorder_child(self._alerts[0], 1) + self.__vbox.reorder_child(self._alerts[0], 1) else: - self._vbox.reorder_child(self._alert[0], 0) + self.__vbox.reorder_child(self._alert[0], 0) def __window_realize_cb(self, window): group = gtk.Window() -- cgit v0.9.1