wxMenu *submenu,
const wxString& help = wxPyEmptyString));
+ wxMenuItem* AppendSubMenu(wxMenu *submenu,
+ const wxString& text,
+ 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,
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,
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));
bool Delete(int id);
%Rename(DeleteItem, bool, Delete(wxMenuItem *item));
- // delete the item from menu and destroy it (if it's a submenu)
+ %pythonAppend Destroy "args[0].thisown = 0"
%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));
const wxString& help = wxPyEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu* subMenu = NULL);
+ ~wxMenuItem();
// the menu we're in
wxMenu *GetMenu() const;