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
class wxMenuItem : public wxObject {
public:
- wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_ANY,
+ // turn off this typemap
+ %typemap(out) wxMenuItem*;
+
+ wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
const wxString& text = wxPyEmptyString,
const wxString& help = wxPyEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu* subMenu = NULL);
~wxMenuItem();
+ // Turn it back on again
+ %typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); }
+
+ // Make Destroy a NOP. The destruction will be handled by SWIG.
+ %pythoncode { def Destroy(self): pass }
+
+
// the menu we're in
wxMenu *GetMenu() const;
void SetMenu(wxMenu* menu);