aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-01-29 04:36:01 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-01-29 04:36:01 +0000
commit2590d97005eecab111a4bf8476da9eb1c700654c (patch)
treea220d519aae546a2cd6481004117e3de1d9a5c32 /lib
parentcd621fe499141885e5a0d8b4e42a0f8a7f41a9ac (diff)
downloadenigma2-2590d97005eecab111a4bf8476da9eb1c700654c.tar.gz
enigma2-2590d97005eecab111a4bf8476da9eb1c700654c.zip
- minor bugfix (allow empty content)
- allow tuples as list elements - fake main menu
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/elistbox.cpp3
-rw-r--r--lib/gui/elistboxcontent.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index e06ab3e6..5a9ee4d6 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -10,7 +10,8 @@ void eListbox::setContent(iListboxContent *content)
{
m_content = content;
invalidate();
- m_content->cursorHome();
+ if (m_content)
+ m_content->cursorHome();
m_top = 0;
m_selected = 0;
}
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>";