X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5a7caf6b618bd32f308251943035d05932c603a..095315e20d117d292ea01f8f964b19c032a0fd56:/wxPython/src/_sizers.i diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index 9dc3a93a03..26e7c75cb4 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -261,6 +261,18 @@ isn't any.", ""); return Py_None; } } + + DocStr(SetUserData, + "Associate a Python object with this sizer item.", ""); + void SetUserData(PyObject* userData) { + wxPyUserData* data = NULL; + if ( userData ) { + wxPyBlock_t blocked = wxPyBeginBlockThreads(); + data = new wxPyUserData(userData); + wxPyEndBlockThreads(blocked); + } + self->SetUserData(data); + } } }; @@ -318,14 +330,14 @@ static wxPySizerItemInfo wxPySizerItemTypeHelper(PyObject* item, bool checkSize, if ( !(info.window || info.sizer || (checkSize && info.gotSize) || (checkIdx && info.gotPos)) ) { // no expected type, figure out what kind of error message to generate if ( !checkSize && !checkIdx ) - PyErr_SetString(PyExc_TypeError, "wxWindow or wxSizer expected for item"); + PyErr_SetString(PyExc_TypeError, "wx.Window or wx.Sizer expected for item"); else if ( checkSize && !checkIdx ) - PyErr_SetString(PyExc_TypeError, "wxWindow, wxSizer, wxSize, or (w,h) expected for item"); + PyErr_SetString(PyExc_TypeError, "wx.Window, wx.Sizer, wx.Size, or (w,h) expected for item"); else if ( !checkSize && checkIdx) - PyErr_SetString(PyExc_TypeError, "wxWindow, wxSizer or int (position) expected for item"); + PyErr_SetString(PyExc_TypeError, "wx.Window, wx.Sizer or int (position) expected for item"); else // can this one happen? - PyErr_SetString(PyExc_TypeError, "wxWindow, wxSizer, wxSize, or (w,h) or int (position) expected for item"); + PyErr_SetString(PyExc_TypeError, "wx.Window, wx.Sizer, wx.Size, or (w,h) or int (position) expected for item"); } return info; @@ -635,7 +647,7 @@ was found and detached.", ""); "GetItem(self, item) -> wx.SizerItem", "Returns the `wx.SizerItem` which holds the *item* given. The *item* parameter can be either a window, a sizer, or the zero-based index of -the item to be detached.", ""); +the item to be found.", ""); wxSizerItem* GetItem(PyObject* item) { wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true);