diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2006-02-24 14:14:57 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2006-02-24 14:14:57 +0000 |
| commit | df7d9f3578c68b22c95ab9daa23bd0fa168f6d11 (patch) | |
| tree | e02e31f3370f92ecaac63d6824942bafead2fbe6 /lib/python/Components/GUIComponent.py | |
| parent | 00baaebc6c9a408dcde721da3fed8b03a90fd28e (diff) | |
| download | enigma2-df7d9f3578c68b22c95ab9daa23bd0fa168f6d11.tar.gz enigma2-df7d9f3578c68b22c95ab9daa23bd0fa168f6d11.zip | |
generic show/hide support for GUIComponents
Diffstat (limited to 'lib/python/Components/GUIComponent.py')
| -rw-r--r-- | lib/python/Components/GUIComponent.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/python/Components/GUIComponent.py b/lib/python/Components/GUIComponent.py index 5483d181..1476ba83 100644 --- a/lib/python/Components/GUIComponent.py +++ b/lib/python/Components/GUIComponent.py @@ -5,8 +5,12 @@ from enigma import ePoint class GUIComponent: """ GUI component """ + SHOWN = 0 + HIDDEN = 1 + def __init__(self): - pass + self.state = self.SHOWN + self.instance = None def execBegin(self): pass @@ -16,7 +20,19 @@ class GUIComponent: # this works only with normal widgets - if you don't have self.instance, override this. def applySkin(self, desktop): + if self.state == self.HIDDEN: + self.instance.hide() skin.applyAllAttributes(self.instance, desktop, self.skinAttributes) def move(self, x, y): self.instance.move(ePoint(int(x), int(y))) + + def show(self): + self.state = self.SHOWN + if self.instance is not None: + self.instance.show() + + def hide(self): + self.state = self.HIDDEN + if self.instance is not None: + self.instance.hide() |
