From fb412ff32c7938649c72d55eed3f5c8ccb5e0a99 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Thu, 25 May 2006 23:14:05 +0000 Subject: add timeout for MessageBox screens (just add timeout= as argument when creating MessageBox instances) --- lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py') diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py index e6d83bf5..e074aeec 100644 --- a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py @@ -49,8 +49,14 @@ class Test(Screen): self.onShown.append(self.openTest) def openTest(self): - self.session.open(InputBox) - + self.session.openWithCallback(self.callback, MessageBox, _("Test-Messagebox?")) + +# self.session.open(InputBox) + + def callback(self, answer): + print "answer:", answer + self.close() + def keyLeft(self): self["text"].left() @@ -69,7 +75,8 @@ class Test(Screen): self["text"].number(number) def main(session, **kwargs): - session.openWithCallback(test, ChoiceBox, title="Delete everything on this Dreambox?", list=[(_("yes"), "yes"), (_("no"), "no"), (_("perhaps"), "perhaps"), (_("ask me tomorrow"), "ask me tomorrow"), (_("leave me alone with this!"), "yes")]) + session.openWithCallback(test, MessageBox, _("Test-Messagebox?"), timeout = 10) + #session.openWithCallback(test, ChoiceBox, title="Delete everything on this Dreambox?", list=[(_("yes"), "yes"), (_("no"), "no"), (_("perhaps"), "perhaps"), (_("ask me tomorrow"), "ask me tomorrow"), (_("leave me alone with this!"), "yes")]) def test(returnValue): print "You entered", returnValue -- cgit v1.2.3