X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/31688e1b8f028059a700a92a8276c97928abd260..3af66122574386a2856e83ba9c5d73d27a6f3710:/lib/gui/elistboxcontent.cpp diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 2f05f5dc..209b5250 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -29,6 +29,14 @@ iListboxContent::~iListboxContent() { } +iListboxContent::iListboxContent(): m_listbox(0) +{ +} + +void iListboxContent::setListbox(eListbox *lb) +{ + m_listbox = lb; +} DEFINE_REF(eListboxTestContent); @@ -203,11 +211,6 @@ int eListboxStringContent::size() return m_size; } -RESULT eListboxStringContent::connectItemChanged(const Slot0 &itemChanged, ePtr &connection) -{ - return 0; -} - void eListboxStringContent::setSize(const eSize &size) { m_itemsize = size; @@ -316,11 +319,6 @@ int eListboxPythonStringContent::size() return PyList_Size(m_list); } -RESULT eListboxPythonStringContent::connectItemChanged(const Slot0 &itemChanged, ePtr &connection) -{ - return 0; -} - void eListboxPythonStringContent::setSize(const eSize &size) { m_itemsize = size; @@ -337,6 +335,10 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, { PyObject *item = PyList_GetItem(m_list, m_cursor); // borrowed reference! painter.setFont(fnt); + + /* the user can supply tuples, in this case the first one will be displayed. */ + if (PyTuple_Check(item)) + item = PyTuple_GetItem(item, 0); const char *string = PyString_Check(item) ? PyString_AsString(item) : "";