Changes needed to be able to build with SWIG 1.3.24, 1.3.27 as well as
the upcoming 1.3.28, using #if statements on SWIG_VERSION. Adjustments to ownership of SWIG objects, add some destructors and explicitly disown non-window objects when their ownership is transfered to a C++ object. Since all window objects are owned by their parent, or by themselves, always set their thisown attribute to False. Explicitly set thisown to False after any Destroy() methods are called, so SWIG doesn't try to destroy them again. Etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -43,6 +43,8 @@ methods are called.
|
||||
|
||||
:see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`", "");
|
||||
|
||||
|
||||
~wxSizerItem();
|
||||
|
||||
|
||||
%extend {
|
||||
@@ -86,6 +88,7 @@ methods are called.
|
||||
int border, PyObject* userData=NULL ),
|
||||
"Constructs a `wx.SizerItem` for tracking a subsizer", "");
|
||||
|
||||
%disownarg( wxSizer *sizer );
|
||||
%RenameCtor(SizerItemSizer, wxSizerItem( wxSizer *sizer, int proportion, int flag,
|
||||
int border, PyObject* userData=NULL ))
|
||||
{
|
||||
@@ -97,6 +100,7 @@ methods are called.
|
||||
}
|
||||
return new wxSizerItem(sizer, proportion, flag, border, data);
|
||||
}
|
||||
%cleardisown( wxSizer *sizer );
|
||||
}
|
||||
|
||||
|
||||
@@ -214,9 +218,11 @@ added, if needed.", "");
|
||||
wxSizer *, GetSizer(),
|
||||
"Get the subsizer (if any) that is managed by this sizer item.", "");
|
||||
|
||||
%disownarg( wxSizer *sizer );
|
||||
DocDeclStr(
|
||||
void , SetSizer( wxSizer *sizer ),
|
||||
"Set the subsizer to be managed by this sizer item.", "");
|
||||
%cleardisown( wxSizer *sizer );
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
@@ -395,7 +401,8 @@ method to determine where the drawing operations should take place.
|
||||
class wxSizer : public wxObject {
|
||||
public:
|
||||
// wxSizer(); **** abstract, can't instantiate
|
||||
// ~wxSizer();
|
||||
|
||||
~wxSizer();
|
||||
|
||||
%extend {
|
||||
void _setOORInfo(PyObject* _self) {
|
||||
@@ -512,6 +519,8 @@ public:
|
||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||
data = new wxPyUserData(userData);
|
||||
if ( info.sizer )
|
||||
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
|
||||
// Now call the real Add method if a valid item type was found
|
||||
@@ -543,6 +552,8 @@ the item at index *before*. See `Add` for a description of the parameters.", ""
|
||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||
data = new wxPyUserData(userData);
|
||||
if ( info.sizer )
|
||||
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
|
||||
// Now call the real Insert method if a valid item type was found
|
||||
@@ -575,6 +586,8 @@ this sizer. See `Add` for a description of the parameters.", "");
|
||||
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false);
|
||||
if ( userData && (info.window || info.sizer || info.gotSize) )
|
||||
data = new wxPyUserData(userData);
|
||||
if ( info.sizer )
|
||||
PyObject_SetAttrString(item,"thisown",Py_False);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
|
||||
// Now call the real Prepend method if a valid item type was found
|
||||
@@ -693,6 +706,9 @@ the item to be found.", "");
|
||||
return self._SetItemMinSize(item, args[0])
|
||||
}
|
||||
|
||||
|
||||
%disownarg( wxSizerItem *item );
|
||||
|
||||
DocDeclAStrName(
|
||||
wxSizerItem* , Add( wxSizerItem *item ),
|
||||
"AddItem(self, SizerItem item)",
|
||||
@@ -711,6 +727,7 @@ the item to be found.", "");
|
||||
"Prepends a `wx.SizerItem` to the sizer.", "",
|
||||
PrependItem);
|
||||
|
||||
%cleardisown( wxSizerItem *item );
|
||||
|
||||
|
||||
%pythoncode {
|
||||
|
Reference in New Issue
Block a user