aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/Screen.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-01-26 13:29:28 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-01-26 13:29:28 +0000
commitbb9ce4897ba4326cd0cdf4b394631c679ba353dc (patch)
tree02aa2ed38fbcba2b2a565f10cd7905f876701fd8 /lib/python/Screens/Screen.py
parent6077e08da9e6c94c708b30bcc088dc468f219627 (diff)
downloadenigma2-bb9ce4897ba4326cd0cdf4b394631c679ba353dc.tar.gz
enigma2-bb9ce4897ba4326cd0cdf4b394631c679ba353dc.zip
show, hide is now supported in screen, adding onShow (!= onShown), onHide
Diffstat (limited to 'lib/python/Screens/Screen.py')
-rw-r--r--lib/python/Screens/Screen.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py
index 3c635831..a8d0b048 100644
--- a/lib/python/Screens/Screen.py
+++ b/lib/python/Screens/Screen.py
@@ -15,7 +15,11 @@ class Screen(dict, HTMLSkin, GUISkin):
self.onExecBegin = [ ]
self.onShown = [ ]
+ self.onShow = [ ]
+ self.onHide = [ ]
+
self.execing = False
+ self.shown = False
# in order to support screens *without* a help,
# we need the list in every screen. how ironic.
@@ -72,3 +76,19 @@ class Screen(dict, HTMLSkin, GUISkin):
def setFocus(self, o):
self.instance.setFocus(o.instance)
+
+ def show(self):
+ if self.shown:
+ return
+ self.shown = True
+ self.instance.show()
+ for x in self.onShow:
+ x()
+
+ def hide(self):
+ if not self.shown:
+ return
+ self.shown = False
+ self.instance.hide()
+ for x in self.onHide:
+ x()