wxPython - IsSubMenu() function in wx.MenuItem Last Updated : 09 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about IsSubMenu() function associated with wx.MenuItem class of wxPython. IsSubMenu() function simply returns True if the item is a submenu and False if the item is not a submenu. No parameters are required by IsSubMenu() function. Syntax: wx.MenuItem.IsSubMenu(self) Parameters: No parameters are required by IsSubMenu() function. Return Type: bool 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): menubar = wx.MenuBar() fileMenu = wx.Menu() sm = wx.Menu() sm.Append(wx.ID_ANY, 'Submenu item 1') sm.Append(wx.ID_ANY, 'Submenu item 2') sm.Append(wx.ID_ANY, 'Submenu item 3') item = wx.MenuItem(fileMenu, 1, '&Check\tCtrl + c', helpString ="Check Help") item.SetSubMenu(sm) fileMenu.AppendMenu(wx.ID_ANY, 'I&mport', sm) n = item.IsSubMenu() # if item is sub menu if(n == True): print("Item is SubMenu Item") else: print("Item is not a SubMenu Item") menubar.Append(fileMenu, '&File') self.SetMenuBar(menubar) self.SetSize((350, 250)) self.SetTitle('Submenu') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output: Item is SubMenu Item. Output Window: Comment More infoAdvertise with us Next Article wxPython - IsSubMenu() function in wx.MenuItem R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - IsEnabled() function in wx.MenuItem In this article we are going to learn about IsEnabled() function associated with wx.MenuItem class of wxPython. IsEnabled() returns True if the item is enabled. No parameters are required in IsEnabled() function. Syntax: wx.MenuItem.IsEnabled(self) Parameters: No parameters are required in IsEnabled 2 min read wxPython - IsCheck() function in wx.MenuItem In this article we are going to learn about IsCheck() method associated with wx.MenuItem class of wxPython. IsCheck() method simply returns True if the item is a check item and False if item is not a check item. Note that unlike IsCheckable() this doesnât return True for the radio buttons. Syntax: w 1 min read wxPython - GetSubMenu() function in wx.MenuItem In this article we are going to learn about GetSubMenu() function associated with the class wx.MenuItem in wxPython. GetSubMenu() function returns the submenu associated with the menu item, or None if there isnât one. No arguments are needed in GetSubMenu() function. Syntax: wx.MenuItem.GetSubMenu(s 1 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 - IsChecked() function in wx.MenuItem In this article we are going to learn about IsChecked() function associated with wx.MenuItem class of wxPython. IsChecked(self) returns True if the item is checked and False if the item is unchecked. No parameters are required by this function. Syntax: wx.IsChecked(self) Parameters: No parameters ar 1 min read Like