renable callable func to selectable func
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 31 Jul 2007 10:09:49 +0000 (10:09 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 31 Jul 2007 10:09:49 +0000 (10:09 +0000)
lib/gui/elistboxcontent.cpp
lib/gui/elistboxcontent.h

index fbbbb6ff2b7070480cdbace34895d5a0d0b38b9c..24a2951242807d94bf377a8f698b5d736c5b958e 100644 (file)
@@ -392,7 +392,7 @@ eListboxPythonMultiContent::eListboxPythonMultiContent()
 eListboxPythonMultiContent::~eListboxPythonMultiContent()
 {
        Py_XDECREF(m_buildFunc);
-       Py_XDECREF(m_callableFunc);
+       Py_XDECREF(m_selectableFunc);
 }
 
 void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
@@ -803,11 +803,11 @@ void eListboxPythonMultiContent::setBuildFunc(ePyObject cb)
        Py_XINCREF(m_buildFunc);
 }
 
-void eListboxPythonMultiContent::setCallableFunc(ePyObject cb)
+void eListboxPythonMultiContent::setSelectableFunc(ePyObject cb)
 {
-       Py_XDECREF(m_callableFunc);
-       m_callableFunc=cb;
-       Py_XINCREF(m_callableFunc);
+       Py_XDECREF(m_selectableFunc);
+       m_selectableFunc=cb;
+       Py_XINCREF(m_selectableFunc);
 }
 
 int eListboxPythonMultiContent::currentCursorSelectable()
@@ -815,15 +815,15 @@ int eListboxPythonMultiContent::currentCursorSelectable()
        /* each list-entry is a list of tuples. if the first of these is none, it's not selectable */
        if (m_list && cursorValid())
        {
-               if (m_callableFunc && PyCallable_Check(m_callableFunc))
+               if (m_selectableFunc && PyCallable_Check(m_selectableFunc))
                {
                        ePyObject args = PyList_GET_ITEM(m_list, m_cursor); // borrowed reference!
                        if (PyTuple_Check(args))
                        {
-                               ePyObject ret = PyObject_CallObject(m_callableFunc, args);
+                               ePyObject ret = PyObject_CallObject(m_selectableFunc, args);
                                if (ret)
                                        return ret == Py_True;
-                               eDebug("call m_callableFunc failed!!! assume not callable");
+                               eDebug("call m_selectableFunc failed!!! assume not callable");
                        }
                        else
                                eDebug("m_list[m_cursor] is not a tuple!!! assume not callable");
index d3df3b143db3210b971013ada5d998754fc94377..d69beb759364b31dca9d492074c40df3027538ad 100644 (file)
@@ -62,7 +62,7 @@ private:
 class eListboxPythonMultiContent: public eListboxPythonStringContent
 {
        ePyObject m_buildFunc;
-       ePyObject m_callableFunc;
+       ePyObject m_selectableFunc;
        eRect m_selection_clip;
        gRegion m_temp_clip;
 public:
@@ -74,7 +74,7 @@ public:
        
        void setFont(int fnt, gFont *fnt);
        void setBuildFunc(SWIG_PYOBJECT(ePyObject) func);
-       void setCallableFunc(SWIG_PYOBJECT(ePyObject) func);
+       void setSelectableFunc(SWIG_PYOBJECT(ePyObject) func);
        void setItemHeight(int height);
        void setSelectionClip(eRect &rect, bool update=false);
 private: