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.
wx.ToolBar.CreateTool(self, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, clientData=None, shortHelp=””, longHelp=””)
Parameter Input Type Description toolid int An integer by which the tool may be identified in subsequent operations. label string The string to be displayed with the tool. bmpNormal wx.bitmap The primary tool bitmap. bmpDisabled wx.bitmap The bitmap used when the tool is disabled. kind int kind of toolbar. clientData PyUserData An optional pointer to client data which can be retrieved later using GetToolClientData. shortHelp string This string is used for the tools tooltip. longHelp string detailed string associated with tool.
On starting Application:
On clicking button:
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. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course