"""Turns a simple python list into a list which can be used in a listbox."""
def __init__(self, type):
Converter.__init__(self, type)
+ self.content = None
def changed(self, what):
- self.content = eListboxPythonStringContent()
+ if not self.content:
+ self.content = eListboxPythonStringContent()
+
if self.source:
self.content.setList(self.source.list)
self.downstream_elements.changed(what)
@cached
def getCurrent(self):
- if self.source is None:
+ if self.source is None or self.index is None or self.index >= len(self.source.list):
return None
return self.source.list[self.index]
def setIndex(self, index):
if self.master is not None:
self.master.index = index
-
+
index = property(getIndex, setIndex)