if (m_list && cursorValid())
{
PyObject *item = PyList_GET_ITEM(m_list, m_cursor);
if (m_list && cursorValid())
{
PyObject *item = PyList_GET_ITEM(m_list, m_cursor);
- if (PyTuple_Check(item))
- item = PyTuple_GET_ITEM(item, 0);
-
- if (item != Py_None)
+ if (!PyTuple_Check(item))
+ return 1;
+ if (PyTuple_Size(item) >= 2)
PyObject *item = PyList_GET_ITEM(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))
PyObject *item = PyList_GET_ITEM(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))
{
const char *string = PyString_Check(item) ? PyString_AsString(item) : "<not-a-string>";
ePoint text_offset = offset + (selected ? ePoint(2, 2) : ePoint(1, 1));
{
const char *string = PyString_Check(item) ? PyString_AsString(item) : "<not-a-string>";
ePoint text_offset = offset + (selected ? ePoint(2, 2) : ePoint(1, 1));
if (m_list && cursorValid())
{
PyObject *item = PyList_GET_ITEM(m_list, m_cursor);
if (m_list && cursorValid())
{
PyObject *item = PyList_GET_ITEM(m_list, m_cursor);