return res
-class PlayList(HTMLComponent, GUIComponent, MenuList):
+class PlayList(MenuList, HTMLComponent, GUIComponent):
def __init__(self):
GUIComponent.__init__(self)
self.l = eListboxPythonMultiContent()
self.oldCurrPlaying = -1
def clear(self):
- self.list = []
+ del self.list[:]
self.l.setList(self.list)
-
- def GUIcreate(self, parent):
- self.instance = eListbox(parent)
- self.instance.setContent(self.l)
- self.instance.setItemHeight(32)
-
+ self.currPlaying = 0
+ self.oldCurrPlaying = -1
+
+ GUI_WIDGET = eListbox
+
+ def postWidgetCreate(self, instance):
+ instance.setContent(self.l)
+ instance.setItemHeight(32)
+
def getSelection(self):
return self.l.getCurrentSelection()[0]
def deleteFile(self, index):
if self.currPlaying >= index:
self.currPlaying -= 1
- self.list = self.list[:index] + self.list[index + 1:]
-
+ del self.list[index]
+
def setCurrentPlaying(self, index):
self.oldCurrPlaying = self.currPlaying
self.currPlaying = index
return list
def __len__(self):
- return len(self.list)
\ No newline at end of file
+ return len(self.list)