GUI_WIDGET = eListbox
def selectionChanged(self):
- if self.current:
+ if isinstance(self.current,tuple) and len(self.current) == 2:
self.current[1].onDeselect(self.session)
self.current = self.getCurrent()
- if self.current:
+ if isinstance(self.current,tuple) and len(self.current) == 2:
self.current[1].onSelect(self.session)
-
+ else:
+ return
for x in self.onSelectionChanged:
x()
instance.setContent(self.l)
def preWidgetRemove(self, instance):
- if self.current:
+ if isinstance(self.current,tuple) and len(self.current) == 2:
self.current[1].onDeselect(self.session)
instance.selectionChanged.get().remove(self.selectionChanged)
instance.setContent(None)
-
+
def setList(self, l):
self.timer.stop()
self.__list = l
if l is not None:
for x in l:
- assert isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
+ assert len(x) < 2 or isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
def getList(self):
return self.__list