- def __init__(self, session, parent):
- Screen.__init__(self, session)
- self["MenuTitle"] = Label(parent.menu_title)
- self["MenuEntry"] = Label("")
- self["CurrentTime"] = Clock()
- self.parent = parent
- self.onShow.append(self.addWatcher)
- self.onHide.append(self.removeWatcher)
-
- def addWatcher(self):
- self.parent["menu"].onSelectionChanged.append(self.selectionChanged)
- self.selectionChanged()
-
- def removeWatcher(self):
- self.parent["menu"].onSelectionChanged.remove(self.selectionChanged)
-
- def selectionChanged(self):
- self["MenuEntry"].setText(self.parent["menu"].getCurrent()[0])
-