Skip to content
Related Articles

Related Articles

wxPython – IsEnabled() function in wx.MenuBar
  • Last Updated : 10 Jun, 2020
GeeksforGeeks - Summer Carnival Banner

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.IsEnabled(self, id)


ParameterInput TypeDescription
idintThe menu item identifier.

Code Example:

import wx
class Example(wx.Frame):
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs)
    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"
                                                              kind = wx.ITEM_CHECK)
        self.menubar.Append(self.fileMenu, '&File')
        self.SetSize((350, 250))
        self.SetTitle('New Frame Title')
        if(self.menubar.IsEnabled(1)== True):
            # print CLICKABLE if True
            # else print UNCLICKABLE
def main():
    app = wx.App()
    ex = Example(None)
if __name__ == '__main__':


Console Output:


Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :