X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dc0f664d75b08f7fb5320d5f47d7d4a32db31ab..c33c11fa1d2a0c4999e04386e04ac96cd350e853:/wxPython/src/_listbox.i?ds=inline diff --git a/wxPython/src/_listbox.i b/wxPython/src/_listbox.i index e4f638f3c0..22960358a4 100644 --- a/wxPython/src/_listbox.i +++ b/wxPython/src/_listbox.i @@ -104,10 +104,9 @@ public: // works for single as well as multiple selection listboxes (unlike // GetSelection which only works for listboxes with single selection) //virtual int GetSelections(wxArrayInt& aSelections) const; - %extend - { - PyObject* GetSelections() - { + %extend { + PyObject* GetSelections() { + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxArrayInt lst; self->GetSelections(lst); PyObject *tup = PyTuple_New(lst.GetCount()); @@ -115,6 +114,7 @@ public: { PyTuple_SetItem(tup, i, PyInt_FromLong(lst[i])); } + wxPyEndBlockThreads(blocked); return tup; } } @@ -165,6 +165,8 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(Selections, GetSelections, doc="See `GetSelections`"); }; @@ -205,7 +207,14 @@ public: #if defined(__WXMSW__) || defined(__WXGTK__) int GetItemHeight(); +#else + %pythoncode { + def GetItemHeight(self): + raise NotImplementedError + } #endif + + %property(ItemHeight, GetItemHeight, doc="See `GetItemHeight`"); }; //---------------------------------------------------------------------------