No need to fullscreen: matchbox does it for us
[gregoa/zavai.git] / zavai / app.py
index 29311de8ff6ad1279a81f5306d0f71b71cde9977..2d8020e245f041eab9d466ea2264e105c0590fb8 100644 (file)
@@ -18,7 +18,7 @@
 
 import sys
 from gettext import gettext as _
-import gtk
+import gtk, gobject
 import zavai
 
 class Zavai(gtk.Window, zavai.Resource):
@@ -55,18 +55,30 @@ class Zavai(gtk.Window, zavai.Resource):
         widget.show_all()
 
     def run(self):
-        self.fullscreen()
+        #self.fullscreen()
         self.show_all()
         gtk.main()
 
-class Applet(zavai.Resource):
-    def __init__(self, registry, name):
+class Applet(gtk.VBox):
+    name = gobject.property(type=str)
+    label = gobject.property(type=str)
+
+    def __init__(self, registry, name, label = None):
         super(Applet, self).__init__()
+
         self.zavai_registry = registry
-        self.zavai_name = name
 
-    def make_parent_link(self):
-        return zavai.LinkButton(self.zavai_registry, zavai.get_parent(self.zavai_name), _("Back"))
+        self.props.name = name
+        if label is None:
+            self.props.label = zavai.default_label(name)
+        else:
+            self.props.label = label
+
+        self.back_link = zavai.LinkButton(registry, zavai.get_parent(name), _("Back"))
+        self.pack_end(self.back_link, False, False)
+
+    def add(self, widget):
+        self.pack_start(widget, True, True)
 
     def shutdown(self):
         self.stop()