Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-04-27 08:51:19 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-04-27 08:51:19 (GMT)
commit9ccda70199c098ea6b45bec059225976cfb3b0d7 (patch)
treee3ad7f8a0da47eb283f9bb9bb042da395abb9824 /shell
parent9dcfcf89e96894d32905bfe9bae3e1310a21ae1b (diff)
Refactor the window API a bit to make it more flexible.
Diffstat (limited to 'shell')
-rw-r--r--shell/view/home/HomeWindow.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/shell/view/home/HomeWindow.py b/shell/view/home/HomeWindow.py
index c65432d..d59bee9 100644
--- a/shell/view/home/HomeWindow.py
+++ b/shell/view/home/HomeWindow.py
@@ -19,7 +19,6 @@ import hippo
import cairo
from sugar.graphics.menushell import MenuShell
-from sugar.graphics.window import Window
from sugar.graphics import units
import sugar
@@ -33,13 +32,18 @@ _FRIENDS_PAGE = 1
_MESH_PAGE = 2
_TRANSITION_PAGE = 3
-class HomeWindow(Window):
+class HomeWindow(gtk.Window):
def __init__(self, shell):
- Window.__init__(self)
+ gtk.Window.__init__(self)
+
self._shell = shell
self._active = False
self._level = sugar.ZOOM_HOME
+ self._canvas = hippo.Canvas()
+ self.add(self._canvas)
+ self._canvas.show()
+
self.set_default_size(gtk.gdk.screen_width(),
gtk.gdk.screen_height())
@@ -54,7 +58,7 @@ class HomeWindow(Window):
self._mesh_box = MeshBox(shell, MenuShell(self))
self._transition_box = TransitionBox()
- self.canvas.set_root(self._home_box)
+ self._canvas.set_root(self._home_box)
self._transition_box.connect('completed',
self._transition_completed_cb)
@@ -81,7 +85,7 @@ class HomeWindow(Window):
def set_zoom_level(self, level):
self._level = level
- self.canvas.set_root(self._transition_box)
+ self._canvas.set_root(self._transition_box)
if level == sugar.ZOOM_HOME:
scale = units.XLARGE_ICON_SCALE
@@ -94,11 +98,11 @@ class HomeWindow(Window):
def _transition_completed_cb(self, transition_box):
if self._level == sugar.ZOOM_HOME:
- self.canvas.set_root(self._home_box)
+ self._canvas.set_root(self._home_box)
elif self._level == sugar.ZOOM_FRIENDS:
- self.canvas.set_root(self._friends_box)
+ self._canvas.set_root(self._friends_box)
elif self._level == sugar.ZOOM_MESH:
- self.canvas.set_root(self._mesh_box)
+ self._canvas.set_root(self._mesh_box)
self._update_mesh_state()