X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/203bfdca0c885d6ac295e4ffea1c95d80fe75b85..2e57368359ab190b5bbad1849d88f298e30723c9:/wxPython/src/_menu.i diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index 50a3f6e7fc..1bbb3a56e4 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 @@ -358,6 +366,9 @@ public: class wxMenuItem : public wxObject { public: + // turn off this typemap + %typemap(out) wxMenuItem*; + wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_ANY, const wxString& text = wxPyEmptyString, const wxString& help = wxPyEmptyString, @@ -365,6 +376,10 @@ public: wxMenu* subMenu = NULL); ~wxMenuItem(); + // Turn it back on again + %typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); } + + // the menu we're in wxMenu *GetMenu() const; void SetMenu(wxMenu* menu);