aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistboxcontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gui/elistboxcontent.cpp')
-rw-r--r--lib/gui/elistboxcontent.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp
index 2f05f5dc..d3a2e77a 100644
--- a/lib/gui/elistboxcontent.cpp
+++ b/lib/gui/elistboxcontent.cpp
@@ -337,6 +337,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) : "<not-a-string>";