wxPython - SetMenu() function in wx.MenuItem Last Updated : 10 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 Type Description menu wx.Menu Parent menu for this item. 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.st = wx.StaticText(self, label ="", pos =(20, 20), style = wx.ALIGN_LEFT) self.item = wx.MenuItem(None, 1, '&Radio', kind = wx.ITEM_CHECK) # INITIAL MENU WAS NONE NOW INCLUDE MENUITEM TO self.fileMenu self.item.SetMenu(self.fileMenu) self.fileMenu.Append(self.item) self.menubar.Append(self.fileMenu, '&File') self.SetMenuBar(self.menubar) self.SetSize((350, 250)) self.SetTitle('Icons and shortcuts') 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 - SetFont() function in wx.MenuItem R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - SetSubMenu() function in wx.MenuItem In this article we are going to learn about SetSubMenu() function associated with wx.MenuItem class of wxPython. SetSubMenu() is simply used to set the submenu of this menu item. It takes only one argument that is wx.Menu you want to add submenu for item. Syntax: wx.MenuItem.SetSubMenu(self, menu) P 1 min read wxPython - SetHelp() function in wx.MenuItem In this article we are going to learn about SetHelp() function associated with wx.MenuItem class of wxPython. SetHelp() function is simply used to set the help string associated with menu item. SetHelp() function only takes helpstring as a parameter. Syntax: wx.MenuItem.SetHelp(self, helpString) Par 1 min read wxPython - SetFont() function in wx.MenuItem In this article we are going to learn about SetFont() function associated with wx.MenuItem class of wxPython. SetFont() function is used to set the font associated with the menu item. It takes font as parameter which is wx.Font object. Syntax: wx.MenuItem.SetFont(self, font) Parameters: Parameter In 1 min read wxPython - SetItemLabel() function in wx.MenuItem In this article we are going to learn about SetItemLabel() function associated with wx.MenuItem class of wxPython. SetItemLabel() function is used to set the label associated with the menu item in menu. Note that if the ID of this menu item corresponds to a stock ID, then it is not necessary to spec 1 min read wxPython - SetBitmaps() function in wx.MenuItem In this article we are going to learn about SetBitmaps() function associated with the wx.MenuItem class of wxPython. SetBitmaps() function Sets the checked/unchecked bitmaps for the menu item. The first bitmap is also used as the single bitmap for uncheckable menu items. It takes two bitmaps as para 1 min read wxPython - SetTextColour() function in wx.MenuItem In this article we are going to learn about SetTextColour() function associated with wx.MenuItem class of wxPython. SetTextColour() function is used to simply set the text colour associated with the menu item. Only a colour parameter is required in SetTextColour() function. Syntax: wx.MenuItem.GetTe 1 min read Like