aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Label.py
blob: 730a01e594b33b1cfd0c8cb713cfb6a5eaf2ddfa (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
27
28
29
30
31
32
33
34
35
36
from HTMLComponent import *
from GUIComponent import *
from VariableText import *

from ConditionalWidget import *

from enigma import eLabel

class Label(HTMLComponent, GUIComponent, VariableText):
	def __init__(self, text=""):
		GUIComponent.__init__(self)
		VariableText.__init__(self)
		self.setText(text)
	
# html:	
	def produceHTML(self):
		return self.getText()

# GUI:
	def createWidget(self, parent):
		return eLabel(parent)
	
	def getSize(self):
		s = self.instance.calculateSize()
		return (s.width(), s.height())

	def show(self):
		self.instance.show()

	def hide(self):
		self.instance.hide()

class LabelConditional(Label, ConditionalWidget):
	def __init__(self, text = "", withTimer = True):
		ConditionalWidget.__init__(self, withTimer = withTimer)
		Label.__init__(self, text = text)