aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/TextBox.py
blob: 44b8a3cf6b41c739fc08ff574de768fc58d09ae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from Screens.Screen import Screen

from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.ScrollLabel import ScrollLabel

class TextBox(Screen):
	def __init__(self, session, text = ""):
		Screen.__init__(self, session)
		
		self.text = text
		self["text"] = ScrollLabel(self.text)
		
		self["actions"] = ActionMap(["OkCancelActions", "DirectionActions"], 
				{
					"cancel": self.cancel,
					"ok": self.ok,
					"up": self["text"].pageUp,
					"down": self["text"].pageDown,
				}, -1)
		
	def ok(self):
		self.close()
	
	def cancel(self):
		self.close()