diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-05-05 22:58:32 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-05-05 22:58:32 +0000 |
| commit | aa3e781f31a04223416f0a34b25ab95fc0bef429 (patch) | |
| tree | 4b4066b1c1298491db080d6a17cfb5a742edf1c8 /lib/python/Components/PerServiceDisplay.py | |
| parent | 1d7e5720b3e8653604323b981e37af1f6aa61709 (diff) | |
| download | enigma2-aa3e781f31a04223416f0a34b25ab95fc0bef429.tar.gz enigma2-aa3e781f31a04223416f0a34b25ab95fc0bef429.zip | |
- split of Components into different files
- screen (will be split next) must import required modules
Diffstat (limited to 'lib/python/Components/PerServiceDisplay.py')
| -rw-r--r-- | lib/python/Components/PerServiceDisplay.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/python/Components/PerServiceDisplay.py b/lib/python/Components/PerServiceDisplay.py new file mode 100644 index 00000000..bd94318e --- /dev/null +++ b/lib/python/Components/PerServiceDisplay.py @@ -0,0 +1,30 @@ +from GUIComponent import * +from VariableText import * + +from enigma import pNavigation +from enigma import eLabel + +class PerServiceDisplay(GUIComponent, VariableText): + """Mixin for building components which display something which changes on navigation events, for example "service name" """ + + def __init__(self, navcore, eventmap): + GUIComponent.__init__(self) + VariableText.__init__(self) + self.eventmap = eventmap + self.navcore = navcore + self.navcore.event.append(self.event) + + # start with stopped state, so simulate that + self.event(pNavigation.evStopService) + + def event(self, ev): + # loop up if we need to handle this event + if self.eventmap.has_key(ev): + # call handler + self.eventmap[ev]() + + def createWidget(self, parent, skindata): + # by default, we use a label to display our data. + g = eLabel(parent) + return g + |
