+
+void MyFrame::OnSwapMenus(wxCommandEvent& WXUNUSED(event))
+{
+ // Change the menu set around
+ current_bar = 1 - current_bar;
+ SetMenuBar(bar[current_bar]);
+}
+
+void MyFrame::OnReplaceMenu(wxCommandEvent& WXUNUSED(event))
+{
+ wxMenuBar *curr_bar = bar[current_bar];
+ wxMenu *menu = GetFileMenu(3);
+ wxString title = "&File3";
+
+ // Replace the first menu with the same thing
+ int pos = 1;
+ if (pos != wxNOT_FOUND)
+ {
+ curr_bar->Replace(pos, menu, title);
+// SetMenuBar(curr_bar);
+ }
+}
+
+
+void MyFrame::OnRemoveInsertMenu(wxCommandEvent& WXUNUSED(event))
+{
+ wxMenuBar *curr_bar = bar[current_bar];
+ wxMenu *menu = GetFileMenu(current_bar);
+ wxString title = "&File3";
+
+ // Remove the first menu then insert it back in
+ int pos = 1;
+ if (pos != wxNOT_FOUND)
+ {
+ curr_bar->Remove(pos);
+ if (curr_bar->GetMenuCount() != 0)
+ curr_bar->Insert(pos, menu, title);
+ else
+ curr_bar->Append(menu, title);
+
+ SetMenuBar(curr_bar);
+ }
+}
+
+
+