- added ListBoxContents: based on std::list<std::string> and PyList with Strings
[enigma2.git] / screens.py
index 7287898db4d673cf970519d79831396a1455deca..cf1dac10ee4e0d355530b9eaa97b6b44a1ac7a58 100644 (file)
@@ -1,4 +1,5 @@
 from components import *
+import sys
 
 # some screens
 def doGlobal(screen):
@@ -7,26 +8,35 @@ def doGlobal(screen):
 class Screen(dict, HTMLSkin, GUISkin):
        """ bla """
        
+       def close(self):
+               GUISkin.close(self)
+       
 # a test dialog
 class testDialog(Screen):
        def testDialogClick(self):
-               print "test dialog clicked!"
-               self["title"].setText("bla")
+               self["title"].setText(self["menu"].getCurrent())
+
+               self.tries += 1
 
        def __init__(self):
-               HTMLSkin.__init__(self, ("title", "okbutton"))
+               GUISkin.__init__(self)
                b = Button("ok")
                b.onClick = [ self.testDialogClick ]
                self["okbutton"] = b
                self["title"] = Header("Test Dialog - press ok to leave!")
+               self["menu"] = MenuList()
+               
+               self.tries = 0
 
 # a clock display dialog
 class clockDisplay(Screen):
        def okbutton(self):
                print "clockDisplay close"
+               
+               self.session.close()
        
        def __init__(self, clock):
-               HTMLSkin.__init__(self, ("title", "theClock", "okbutton"))
+               GUISkin.__init__(self)
                self["theClock"] = clock
                b = Button("bye")
                b.onClick = [ self.okbutton ]