wxPython | create control tool using CreateTool() function Last Updated : 16 Dec, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report In this function, we are going to learn how can we create a control tool using CreateTool() function. It is another version of CreateTool() function which only takes two parameters that is control and label. Let's see the parameters in detail. Parameters : ParameterInput TypeDescriptioncontrolwx.ControlThe control is to be added.labelstringText to be displayed near the control. Syntax: wx.ToolBar.CreateTool(self, control, label) Code Example: Python3 import wx class Example(wx.Frame): global count count = 0; def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): pnl = wx.Panel(self) self.toolbar = self.CreateToolBar() # declare control ctrl = wx.Control(self.toolbar, id = 19, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, name ='control') # create control tool self.ptool = self.toolbar.CreateTool(ctrl, "control") self.btn = wx.Button(pnl, label ='Add created tool', pos =(20, 20)) self.btn.Bind(wx.EVT_BUTTON, self.Onclick) self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() def Onclick(self, e): # Add control tool self.toolbar.AddTool(self.ptool) self.btn.SetLabel("Added tool") def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output : On starting Application: On clicking Button: Comment More infoAdvertise with us Next Article wxPython | create control tool using CreateTool() function R RahulSabharwal Follow Improve Article Tags : Python Python-wxPython Practice Tags : python Similar Reads wxPython - Create Radio Button using Create() function Create() function is used for the two-step construction of Radio Button in wxPython. Create() function takes different attributes of radio button as an argument Syntax:  wx.RadioButton.Create(parent, id=ID_ANY, label="", pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, nam 1 min read 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 - Create Static Box using Create() method In this article we are going to learn about Static Box in wxPython. A static box is a rectangle drawn around other windows to denote a logical grouping of items. In this article we will create Static Box using two step creation, in order to do that we will use Create() method. Syntax: wx.StaticBox.C 2 min read wxPython - ClearTools() function in wx.Toolbar Another function in wxPython Series we are going to learn is ClearTools() function in wx.ToolBar class of wxPython. ClearTools() is a very basic function of wx.ToolBar. ClearTools() function deletes all the tools in the toolbar. Syntax : wx.ToolBar.CLearTools(self) Return Type: wx.ToolBarToolBase Co 1 min read wxPython - Staticline using Create() function In this article we are going to learn about Create() method associated with wx.StaticLine class of wxPython. A static line is just a line which may be used in a dialog to separate the groups of controls. Create() function creates Staticline using two step creation. The line may be only vertical or h 2 min read Like