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:
@@ -259,6 +259,7 @@ instead.");
|
||||
|
||||
|
||||
|
||||
%pythonAppend Destroy "args[0].thisown = 0"
|
||||
DocDeclStr(
|
||||
virtual bool , Destroy(),
|
||||
"Destroys the window safely. Frames and dialogs are not destroyed
|
||||
@@ -1454,9 +1455,11 @@ be reset back to default.", "");
|
||||
|
||||
|
||||
|
||||
%disownarg( wxCaret *caret );
|
||||
DocDeclStr(
|
||||
void , SetCaret(wxCaret *caret),
|
||||
"Sets the caret associated with the window.", "");
|
||||
%cleardisown( wxCaret *caret );
|
||||
|
||||
DocDeclStr(
|
||||
wxCaret *, GetCaret() const,
|
||||
@@ -1767,7 +1770,10 @@ wxHelpProvider implementation, and not in the window object itself.", "");
|
||||
DocStr(SetToolTip,
|
||||
"Attach a tooltip to the window.", "");
|
||||
%Rename(SetToolTipString, void, SetToolTip( const wxString &tip ));
|
||||
|
||||
%disownarg( wxToolTip *tip );
|
||||
void SetToolTip( wxToolTip *tip );
|
||||
%cleardisown( wxToolTip *tip );
|
||||
|
||||
DocDeclStr(
|
||||
wxToolTip* , GetToolTip() const,
|
||||
@@ -1782,16 +1788,12 @@ wxHelpProvider implementation, and not in the window object itself.", "");
|
||||
// drag and drop
|
||||
// -------------
|
||||
|
||||
// set/retrieve the drop target associated with this window (may be
|
||||
// NULL; it's owned by the window and will be deleted by it)
|
||||
%apply SWIGTYPE *DISOWN { wxPyDropTarget *dropTarget };
|
||||
|
||||
%disownarg( wxPyDropTarget *dropTarget );
|
||||
DocDeclStr(
|
||||
virtual void , SetDropTarget( wxPyDropTarget *dropTarget ),
|
||||
"Associates a drop target with this window. If the window already has
|
||||
a drop target, it is deleted.", "");
|
||||
|
||||
%clear wxPyDropTarget *dropTarget;
|
||||
%cleardisown( wxPyDropTarget *dropTarget );
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
@@ -1855,6 +1857,7 @@ this function gets called automatically by the default EVT_SIZE
|
||||
handler when the window is resized.", "");
|
||||
|
||||
|
||||
%disownarg( wxSizer *sizer );
|
||||
DocDeclStr(
|
||||
void , SetSizer(wxSizer *sizer, bool deleteOld = true ),
|
||||
"Sets the window to have the given layout sizer. The window will then
|
||||
@@ -1868,7 +1871,8 @@ non-None, and False otherwise.", "");
|
||||
void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ),
|
||||
"The same as SetSizer, except it also sets the size hints for the
|
||||
window based on the sizer's minimum size.", "");
|
||||
|
||||
%cleardisown( wxSizer *sizer );
|
||||
|
||||
|
||||
DocDeclStr(
|
||||
wxSizer *, GetSizer() const,
|
||||
@@ -1963,6 +1967,11 @@ wxControl where it returns true.", "");
|
||||
if hasattr(self, '_setCallbackInfo'):
|
||||
self._setCallbackInfo(self, self.__class__)
|
||||
}
|
||||
|
||||
%pythoncode {
|
||||
def SendSizeEvent(self):
|
||||
self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user