wxPython - Remove() function in wx.MenuBar Last Updated : 15 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about Remove() function of wx.MenuBar class. Remove() function removes Menu from a particular position in MenuBar in frame. This function takes pos parameter, that is, position of Menu to be deleted. Parameters : Parameter Input Type Description pos int The position of the new menu in the menu bar Code : Let's create a window with two menus in menubar Menu_one and Menu_two. Python3 import wx class Example(wx.Frame): def __init__(self, *args, **kw): super(Example, self).__init__(*args, **kw) # create MenuBar using MenuBar() function menubar = wx.MenuBar() # add menu to MenuBar fm1 = wx.Menu() fileitem = fm1.Append(20, "one") fm2 = wx.Menu() fileitem2 = fm2.Append(20, "two") menubar.Append(fm1, '&Menu_one') menubar.Append(fm2, '&Menu_two') self.SetMenuBar(menubar) self.SetSize((300, 200)) self.SetTitle('Menu Bar') def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output : Code: Let's write a code to remove Menu_two from menubar. [tabby title="Python3"] Python3 import wx class Example(wx.Frame): def __init__(self, *args, **kw): super(Example, self).__init__(*args, **kw) # create MenuBar using MenuBar() function menubar = wx.MenuBar() # add menu to MenuBar fm1 = wx.Menu() fileitem = fm1.Append(20, "one") fm2 = wx.Menu() fileitem2 = fm2.Append(20, "two") menubar.Append(fm1, '&Menu_one') menubar.Append(fm2, '&Menu_two') self.SetMenuBar(menubar) self.SetSize((300, 200)) self.SetTitle('Menu Bar') # removing Menu_two from menubar menubar.Remove(1) def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output : Comment More infoAdvertise with us Next Article wxPython - Insert() function in wx.MenuBar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - SetLabel() function in wx.MenuBar Another important function in wx.MenuBar is SetLabel() function in wx.MenuBar class of wxPython. SetLabel() function is used to change the Label(title) of the menu item in menubar. It is used only after the menubar has been associated with a frame. Syntax : wx.MenuBar.SetLabel(self, id, label) Param 1 min read wxPython - Detach() function in wx.MenuBar In this article we are going to learn about Detach() function associated with wx.MenuBar class of wxPython. Detach() function simply detaches the menubar associated/attached with the frame. Detach() function takes no arguments. Syntax: wx.MenuBar.Detach(self) Parameters: Detach() function takes no a 1 min read wxPython - Attach() function in wx.MenuBar In this article, we are going to learn about Detach() function associated with wx.MenuBar class of wxPython. Attach() function simply attaches the menubar with the frame. Attach() function takes only one wx.Frame type argument. Syntax: wx.MenuBar.Attach(self, frame)Parameters: ParameterInput TypeDes 1 min read wxPython - SetMenu() function in wx.MenuItem In this article we are going to learn about SetMenu() function associated with wx.MenuItem class of wxPython. SetMenu() function sets the parent menu which will contain this menu item. It takes a single wx.Menu object as parameter. Syntax: wx.MenuItem.SetMenu(self, menu) Parameters: Parameter Input 1 min read wxPython - Insert() function in wx.MenuBar In this article we are going to learn about Insert() function associated to wx.MenuBar class of wxPython. So Insert() function is a very important function in wx.MenuBar class. Insert() function Inserts the menu at the given position into the menu bar. Inserting menu at position 0 will insert it in 1 min read wxPython - SetHelpString() function in wx.MenuBar In this article we are going to learn about another function of class wx.MenuBar in wxPython, that is, SetHelpString(). Set help string associates a Help string along with menu item which is further used for various purposes. Syntax : wx.MenuBar.SetHelpString(self, id, helpString) Parameter : Parame 1 min read Like