fixes bug #380
[enigma2.git] / lib / python / Screens / TextBox.py
1 from Screens.Screen import Screen
2
3 from Components.ActionMap import ActionMap
4 from Components.Sources.StaticText import StaticText
5 from Components.ScrollLabel import ScrollLabel
6
7 class TextBox(Screen):
8         def __init__(self, session, text = ""):
9                 Screen.__init__(self, session)
10                 
11                 self.text = text
12                 self["text"] = ScrollLabel(self.text)
13                 
14                 self["actions"] = ActionMap(["OkCancelActions", "DirectionActions"], 
15                                 {
16                                         "cancel": self.cancel,
17                                         "ok": self.ok,
18                                         "up": self["text"].pageUp,
19                                         "down": self["text"].pageDown,
20                                 }, -1)
21                 
22         def ok(self):
23                 self.close()
24         
25         def cancel(self):
26                 self.close()