[Sugar-devel] [PATCH] Window: allow removing the toolbar_box
Sascha Silbe
sascha-pgp at silbe.org
Sun Jul 4 16:34:14 EDT 2010
Allow the toolbar_box to be removed by setting it to None, like is supported
for canvas.
Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
---
src/sugar/graphics/window.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/sugar/graphics/window.py b/src/sugar/graphics/window.py
index e3bef6b..8f368a8 100644
--- a/src/sugar/graphics/window.py
+++ b/src/sugar/graphics/window.py
@@ -191,8 +191,9 @@ class Window(gtk.Window):
if self._toolbar_box:
self.__vbox.remove(self._toolbar_box)
- self.__vbox.pack_start(toolbar_box, False)
- self.__vbox.reorder_child(toolbar_box, 0)
+ if toolbar_box:
+ self.__vbox.pack_start(toolbar_box, False)
+ self.__vbox.reorder_child(toolbar_box, 0)
self._toolbar_box = toolbar_box
--
tg: (2e4a59a..) t/window-toolbar-remove (depends on: upstream/master)
More information about the Sugar-devel
mailing list