wxPython - EnableTool() function in wx.Toolbar Last Updated : 15 Mar, 2023 Comments Improve Suggest changes Like Article Like Report In this article we are going to learn EnableTool() function of class wx.ToolBar of wxPython. EnableTool is used to enable or disable(make clickable and unclickable) the tool present in toolbar. Syntax : wx.ToolBar.EnableTool(self, toolid, enable) Parameters : ParameterInput TypeDescriptiontoolidintID of the tool to enable or disable, as passed to AddTool .enableboolIf True, enables the tool, otherwise disables it. Code Example: Python3 import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): pnl = wx.Panel(self) self.toolbar = self.CreateToolBar() qtool = self.toolbar.AddTool(12, 'Quit', wx.Bitmap('/Desktop/wxPython/signs.png')) self.toolbar.Realize() self.Bind(wx.EVT_TOOL, self.OnQuit, qtool) self.SetSize((350, 250)) self.SetTitle('Simple toolbar') self.Centre() self.btn = wx.Button(pnl, label ='Disable', pos =(20, 20)) self.btn.Bind(wx.EVT_BUTTON, self.Onclick) self.SetSize((350, 250)) self.SetTitle('wx.Button') self.Centre() def OnQuit(self, e): self.Close() def Onclick(self, e): # disable tool using EnableTool self.toolbar.EnableTool(12, False) 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 - EnableTool() function in wx.Toolbar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython | CreateTool() function in wx.Toolbar In this particular article we are going to learn about CreateTool() function in wx.ToolBar class in wxPython. CreateTool() function is a factory function to create a new toolbar tool. CreateTool() function only creates a tool which is further added using AddTool() function. Syntax: wx.ToolBar.Create 2 min read wxPython - DeleteTool() function in wx.ToolBar In this article we are going to learn about the DeleteTool() function of wx.ToolBar class of wxPython. DeleteTool() removes the specified tool from the toolbar and deletes it. It specifies a tool using a tool identifier. Syntax : wx.toolbar.DeleteTool(self, toolid) Returns: True if the tool was dele 1 min read wxPython - AddTool() function in wx.ToolBar AddTool() is another function in wx.ToolBar class of wxPython. AddTool() function simply adds a tool to the Toolbar. This is another version of AddTool() function with greater number of parameters. it adds parameters like : bmpDisabled, longHelp, clientData. Syntax: wx.ToolBar.AddTool(self, id, labe 2 min read wxPython - AddLabelTool() function in wx.ToolBar In this article we are going to learn about another method in wx.ToolBar class of wxPython, that is, AddLabelTool() method. AddLabelTool() is old style method to add a tool to the toolbar. Syntax: wx.ToolBar.AddLabelTool(self, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortH 1 min read wxPython - AddSimpleTool() function in wx.ToolBar In this article we are going to learn about another method in wx.ToolBar class of wxPython, that is, AddSimpleTool() method. AddSimpleTool() is old style method to add a tool to the toolbar. Syntax: wx.ToolBar.AddSimpleTool(self, id, bitmap, shortHelpString="", isToggle=0) Parameters : ParameterInpu 1 min read Like