Give classes that need one a destructor wrapper, and set %disown when
another class takes ownership. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,16 +55,21 @@ public:
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxPyEmptyString));
|
||||
|
||||
|
||||
%disownarg(wxMenuItem*);
|
||||
// the most generic form of Append() - append anything
|
||||
%Rename(AppendItem, wxMenuItem*, Append(wxMenuItem *item));
|
||||
// insert an item before given position
|
||||
%Rename(InsertItem, wxMenuItem*, Insert(size_t pos, wxMenuItem *item));
|
||||
// prepend an item to the menu
|
||||
%Rename(PrependItem, wxMenuItem*, Prepend(wxMenuItem *item));
|
||||
%cleardisown(wxMenuItem*);
|
||||
|
||||
|
||||
// insert a break in the menu (only works when appending the items, not
|
||||
// inserting them)
|
||||
virtual void Break();
|
||||
|
||||
// insert an item before given position
|
||||
%Rename(InsertItem, wxMenuItem*, Insert(size_t pos, wxMenuItem *item));
|
||||
|
||||
// insert an item before given position
|
||||
wxMenuItem* Insert(size_t pos,
|
||||
int id,
|
||||
@@ -94,9 +99,6 @@ public:
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxPyEmptyString));
|
||||
|
||||
// prepend an item to the menu
|
||||
%Rename(PrependItem, wxMenuItem*, Prepend(wxMenuItem *item));
|
||||
|
||||
// prepend any item to the menu
|
||||
wxMenuItem* Prepend(int id,
|
||||
const wxString& text,
|
||||
@@ -122,9 +124,11 @@ public:
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxPyEmptyString));
|
||||
|
||||
|
||||
// detach an item from the menu, but don't delete it so that it can be
|
||||
// added back later (but if it's not, the caller is responsible for
|
||||
// deleting it!)
|
||||
%newobject Remove;
|
||||
wxMenuItem *Remove(int id);
|
||||
%Rename(RemoveItem, wxMenuItem*, Remove(wxMenuItem *item));
|
||||
|
||||
@@ -323,6 +327,7 @@ public:
|
||||
const wxString& help = wxPyEmptyString,
|
||||
wxItemKind kind = wxITEM_NORMAL,
|
||||
wxMenu* subMenu = NULL);
|
||||
~wxMenuItem();
|
||||
|
||||
// the menu we're in
|
||||
wxMenu *GetMenu() const;
|
||||
|
Reference in New Issue
Block a user