From 4b5a79cf542413329210bda962798a269c2091dd Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 10 Oct 2006 03:30:33 +0000 Subject: [PATCH] Disown using .this.own(False) instead of .thisown = False git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_app_ex.py | 2 +- wxPython/src/_artprov.i | 2 +- wxPython/src/_cshelp.i | 2 +- wxPython/src/_listctrl.i | 2 +- wxPython/src/_log.i | 2 +- wxPython/src/_menu.i | 14 +++++++++++--- wxPython/src/_misc.i | 2 +- wxPython/src/_obj.i | 2 +- wxPython/src/_taskbar.i | 2 +- wxPython/src/_treectrl.i | 2 +- wxPython/src/_window.i | 2 +- wxPython/src/grid.i | 4 ++-- 12 files changed, 23 insertions(+), 15 deletions(-) diff --git a/wxPython/src/_app_ex.py b/wxPython/src/_app_ex.py index fc84315a09..f6f7a5ac3e 100644 --- a/wxPython/src/_app_ex.py +++ b/wxPython/src/_app_ex.py @@ -191,8 +191,8 @@ in on the main display of your Mac.""" destroy(self) def Destroy(self): + self.this.own(False) wx.PyApp.Destroy(self) - self.thisown = 0 def SetTopWindow(self, frame): """Set the \"main\" top level window""" diff --git a/wxPython/src/_artprov.i b/wxPython/src/_artprov.i index e0acf44015..3e1444579d 100644 --- a/wxPython/src/_artprov.i +++ b/wxPython/src/_artprov.i @@ -299,7 +299,7 @@ topmost provider if platform_dependent = false", ""); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; }} }; diff --git a/wxPython/src/_cshelp.i b/wxPython/src/_cshelp.i index 2e4b493f65..91b1d230e2 100644 --- a/wxPython/src/_cshelp.i +++ b/wxPython/src/_cshelp.i @@ -285,7 +285,7 @@ table of help strings will fill up and when window pointers are reused, the wrong help string will be found.", ""); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } }; diff --git a/wxPython/src/_listctrl.i b/wxPython/src/_listctrl.i index d53789b681..ce1701e47a 100644 --- a/wxPython/src/_listctrl.i +++ b/wxPython/src/_listctrl.i @@ -174,7 +174,7 @@ public: void AssignFrom(const wxListItemAttr& source); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); diff --git a/wxPython/src/_log.i b/wxPython/src/_log.i index f02fdb8467..48fd12b62b 100644 --- a/wxPython/src/_log.i +++ b/wxPython/src/_log.i @@ -159,7 +159,7 @@ public: } } - %pythonAppend Destroy "args[0].thisown = 0"; + %pythonPrepend Destroy "args[0].this.own(False)"; %extend { void Destroy() { delete self; } } }; diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index 50a3f6e7fc..070d88a407 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -140,12 +140,20 @@ public: bool Delete(int id); %Rename(DeleteItem, bool, Delete(wxMenuItem *item)); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } // delete the item from menu and destroy it (if it's a submenu) - %Rename(DestroyId, bool, Destroy(int id)); - %Rename(DestroyItem, bool, Destroy(wxMenuItem *item)); + %pythonPrepend Destroy ""; + DocDeclStrName( + bool , Destroy(int id), + "", "", + DestroyId); + + DocDeclStrName( + bool , Destroy(wxMenuItem *item), + "", "", + DestroyItem); // get the items diff --git a/wxPython/src/_misc.i b/wxPython/src/_misc.i index 2330298d19..c412e3026f 100644 --- a/wxPython/src/_misc.i +++ b/wxPython/src/_misc.i @@ -54,7 +54,7 @@ public: ~wxCaret(); %extend { - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" DocStr(Destroy, "Deletes the C++ object this Python object is a proxy for.", ""); void Destroy() { diff --git a/wxPython/src/_obj.i b/wxPython/src/_obj.i index 52620e7726..56672a69b7 100644 --- a/wxPython/src/_obj.i +++ b/wxPython/src/_obj.i @@ -30,7 +30,7 @@ public: return self->GetClassInfo()->GetClassName(); } - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" DocStr(Destroy, "Deletes the C++ object this Python object is a proxy for.", ""); void Destroy() { diff --git a/wxPython/src/_taskbar.i b/wxPython/src/_taskbar.i index abdc2c6539..9ae6d12250 100644 --- a/wxPython/src/_taskbar.i +++ b/wxPython/src/_taskbar.i @@ -108,7 +108,7 @@ public: void _setCallbackInfo(PyObject* self, PyObject* _class, int incref); - %pythonAppend Destroy "args[0].thisown = 0"; + %pythonPrepend Destroy "args[0].this.own(False)"; %extend { void Destroy() { self->RemoveIcon(); diff --git a/wxPython/src/_treectrl.i b/wxPython/src/_treectrl.i index e87e7ba7b3..adcac9458b 100644 --- a/wxPython/src/_treectrl.i +++ b/wxPython/src/_treectrl.i @@ -132,7 +132,7 @@ public: const wxTreeItemId& GetId(); void SetId(const wxTreeItemId& id); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } %property(Data, GetData, SetData, doc="See `GetData` and `SetData`"); diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index fd0e6c0db7..b59bf49633 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -259,7 +259,7 @@ instead."); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" DocDeclStr( virtual bool , Destroy(), "Destroys the window safely. Frames and dialogs are not destroyed diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 00fee52e13..69b0c9b4a6 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -750,7 +750,7 @@ public: virtual void StartingClick(); virtual void HandleReturn(wxKeyEvent& event); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" virtual void Destroy(); %property(CellAttr, GetCellAttr, SetCellAttr, doc="See `GetCellAttr` and `SetCellAttr`"); @@ -1345,7 +1345,7 @@ public: wxPyGridTableBase(); void _setCallbackInfo(PyObject* self, PyObject* _class); - %pythonAppend Destroy "args[0].thisown = 0" + %pythonPrepend Destroy "args[0].this.own(False)" %extend { void Destroy() { delete self; } } wxString GetTypeName( int row, int col ); -- 2.45.2