wxPython - Insert() function in wx.MenuBar Last Updated : 10 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 the very beginning of it, inserting at position GetMenuCount is the same as calling Append . Syntax: wx.MenuBar.Insert(self, pos, menu, title) Parameters: Parameter Input Type Description pos int The position of the new menu in the menu bar menu wx.Menu The menu to add. wx.MenuBar owns the menu and will free it. title string The title of the menu. Code Example: Python3 1== import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) self.menubar = wx.MenuBar() self.fileMenu = wx.Menu() self.fileMenu2 = wx.Menu() self.item = wx.MenuItem(self.fileMenu, 1, '&Check', helpString ="Check Help") self.item.SetBitmap(wx.Bitmap('right.png')) self.fileMenu.Append(self.item) self.menubar.Append(self.fileMenu, '&File') # INSERT A NEW MENU IN MENUBAR AT POSITION 0 self.menubar.Insert(0, self.fileMenu2, '&New Menu') self.SetMenuBar(self.menubar) self.SetSize((350, 250)) self.SetTitle('New Frame Title') self.Centre() 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 - InsertTool() function in wx.ToolBar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - IsEnabled() function in wx.MenuBar In this article we are going to learn about IsEnabled() function associated with wx.MenuBar class of wxPython. IsEnabled() function is useful as it determines whether an item is enabled. IsEnabled() function returns True if the item was found and is enabled, False otherwise. Syntax: wx.MenuBar.IsEna 1 min read wxPython - IsChecked() function in wx.MenuBar In this article we are going to learn about IsChecked() function associated with wx.MenuBar class of wxPython. IsChecked() function simply determines whether an item is checked. IsChecked() function returns True if the item was found and is checked, False otherwise. IsChecked() function takes id as 1 min read wxPython - GetMenus() function in wx.MenuBar In this article we are going to learn about GetMenus() function associated with wx.MenuBar class of wxPython. GetMenus() function simply returns a list of (menu, label) items for the menus in the MenuBar. No arguments are required in GetMenus() function. Syntax: wx.MenuBar.GetMenus(self) Parameters: 1 min read wxPython - InsertTool() function in wx.ToolBar In this article we are going to learn about InsertTool() function associated with wx.ToolBar class of wxPython. InsertTool() function is the new style of inserting a tool in the toolbar as a particular position. InsertTool() takes arguments associated with a tool as its parameters. Syntax: wx.ToolBa 2 min read wxPython - IsSeparator() function in wx.MenuItem In this article we are going to learn about IsSeparator() function associated with wx.MenuItem class of wxPython. IsSeparator() function simply returns True if the item is a separator. An item can be declared/set as separator if it's id is wx.ID_SEPARATOR. No parameters are required by IsSeparator() 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 Like