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>2006-07-24 10:48:12 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-24 10:48:12 (GMT)
commit1acd82599aa1c90faae98843c017263b93268190 (patch)
treeb80f68ccfe19ee8feab31934fd37d2db02ae1eaa /shell
parente4a87bea06ef2f5d943888df23a1c03a202dee5b (diff)
Start working on Diana's home window visual design
Diffstat (limited to 'shell')
-rw-r--r--shell/HomeWindow2.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/shell/HomeWindow2.py b/shell/HomeWindow2.py
new file mode 100644
index 0000000..d9a9a0c
--- /dev/null
+++ b/shell/HomeWindow2.py
@@ -0,0 +1,46 @@
+import gtk
+
+from sugar.scene.Stage import Stage
+from sugar.scene.SceneView import SceneView
+from sugar.activity import Activity
+
+class ActivityLauncher(gtk.HButtonBox):
+ def __init__(self, shell):
+ gtk.HButtonBox.__init__(self)
+
+ self._shell = shell
+
+ for module in shell.get_registry().list_activities():
+ button = gtk.Button(module.get_name())
+ activity_id = module.get_id()
+ button.connect('clicked', self.__clicked_cb, activity_id)
+ self.pack_start(button)
+ button.show()
+
+ def __clicked_cb(self, button, activity_id):
+ Activity.create(activity_id)
+
+class HomeScene(SceneView):
+ def __init__(self, shell):
+ self._stage = Stage()
+
+ SceneView.__init__(self, self._stage)
+
+ self._shell = shell
+
+class HomeWindow(gtk.Window):
+ def __init__(self, shell):
+ gtk.Window.__init__(self)
+
+ fixed = gtk.Fixed()
+
+ scene = HomeScene(shell)
+ fixed.put(scene, 0, 0)
+ scene.show()
+
+ launcher = ActivityLauncher(shell)
+ fixed.put(launcher, 0, 0)
+ launcher.show()
+
+ self.add(fixed)
+ fixed.show()