fix arrow movement, do not crash on exit
authorAxel Buehning <axel.buehning@multimedia-labs.de>
Fri, 24 Feb 2006 12:41:48 +0000 (12:41 +0000)
committerAxel Buehning <axel.buehning@multimedia-labs.de>
Fri, 24 Feb 2006 12:41:48 +0000 (12:41 +0000)
lib/python/Components/HelpMenuList.py
lib/python/Screens/HelpMenu.py

index c8ff379..e6f8539 100644 (file)
@@ -52,13 +52,8 @@ class HelpMenuList(GUIComponent):
                self.instance = eListbox(parent)
                self.instance.setContent(self.l)
                self.instance.setItemHeight(42)
-               self.instance.selectionChanged.get().append(self.selectionChanged)
                
        def GUIdelete(self):
                self.instance.setContent(None)
-               self.instance.selectionChanged.get().remove(self.selectionChanged)
                self.instance = None
 
-       def selectionChanged(self):
-               for x in self.onSelChanged:
-                       x()
index e947ac9..cae0a5d 100644 (file)
@@ -18,7 +18,6 @@ class HelpMenu(Screen):
                self.onSelChanged = [ ]
                
                self["list"] = HelpMenuList(list, self.close)
-               self["list"].onSelChanged.append(self.SelectionChanged)
                
                self["rc"] = Pixmap()
                self["arrowup"] = MovingPixmap()
@@ -27,7 +26,17 @@ class HelpMenu(Screen):
                {
                        "ok": self["list"].ok,
                        "back": self.close,
+                       "up": self.up,
+                       "down": self.down
                }, -1)
+       
+       def up(self):
+               self["list"].instance.moveSelection(self["list"].instance.moveUp)
+               self.SelectionChanged()
+               
+       def down(self):
+               self["list"].instance.moveSelection(self["list"].instance.moveDown)
+               self.SelectionChanged()
                
        def SelectionChanged(self):
                selection = self["list"].getCurrent()[3]