wxPython | InsertSimpleTool() function in python Last Updated : 27 Feb, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about InsertSimpleTool() function associated with wx.ToolBar class of wxPython. InsertSimpleTool() function is another old style method to insert a tool in the toolbar. InsertSimpleTool() function inserts the tool with the specified attributes into the toolbar at the given position. Syntax: wx.ToolBar.InsertSimpleTool(self, pos, toolId, bitmap, shortHelpString="", longHelpString="", isToggle=0) Parameters: ParameterInput TypeDescriptionposintPosition of tool to be added starting from 0.toolidintAn integer by which the tool may be identified in subsequent operations.bitmapwx.bitmapThe primary tool bitmap.shortHelpStringstringThis string is used for the tools tooltip.longHelpStringstringdetailed string associated with tool.isToggleint0 for normal 1 for toggle button. Return Type: wx.ToolBarToolBase Code Example 1: Python3 import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) self.toolbar = self.CreateToolBar() td = self.toolbar.AddTool(1, '', wx.Bitmap('user.png')) self.toolbar.Realize() self.Bind(wx.EVT_TOOL, self.OnOne, td) self.SetSize((350, 250)) self.SetTitle('Undo redo') self.Centre() def OnOne(self, e): # insert tool at position 1 self.toolbar.InsertSimpleTool(pos = 1, toolId = 2, bitmap = wx.Bitmap('right.png'), shortHelpString ="new tool one", isToggle = 0) # insert tool at position 2 self.toolbar.InsertSimpleTool(pos = 2, toolId = 3, bitmap = wx.Bitmap('wrong.png'), shortHelpString ="new tool two", isToggle = 0) self.toolbar.Realize() def OnQuit(self, e): self.Close() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output : before clicking profile icon: after clicking profile icon: Comment More infoAdvertise with us Next Article wxPython - InsertTool() function in wx.ToolBar R RahulSabharwal Follow Improve Article Tags : Python Python-wxPython Practice Tags : python Similar Reads wxPython | InsertLabelTool() function in wx.ToolBar In this article we are going to learn about InsertLabelTool() function associated with class wx.ToolBar in wxPython. InsertLabelTool() is an old style method to insert a tool in the toolbar. InsertLabelTool() takes different property of tool as parameters to insert tool. Syntax : wx.ToolBar.InsertLa 2 min read wxPython - InsertTool() function in wx.ToolBar In this article we are going to learn about InsertTool() function associated with wx.ToolBar class of wxPython. InsertTool() function is the new style of inserting a tool in the toolbar as a particular position. InsertTool() takes arguments associated with a tool as its parameters. Syntax: wx.ToolBa 2 min read wxPython | GetToolPos() function in python In this article we are going to learn about GetToolPos() function associated with wx.ToolBar class of wxPython. GetToolPos() function simply returns the tool position in the toolbar, or NOT_FOUND if the tool is not found. GetToolPos() function only takes toolId(ID of the tool in question, as passed 2 min read wxPython | InsertSeparator() function in wx.ToolBar In this article we are going to learn about to learn about InsertSeparator() function associated with wx.ToolBar class of wxPython. InsertSeparator() function simply inserts the separator into the toolbar at the given position. Note that you must call Realize for the change to take place. It takes o 2 min read wxPython | GetToolByPos() function in python In this article we are going to learn about GetToolByPos() function present in wx.ToolBar class of wxPython. GetToolByPos() function is used to simply return a pointer to the tool at specific position. GetToolByPos() function takes a single parameter that is pos(position of tool). Syntax: wx.ToolBar 2 min read wxPython - Insert() function in wx.MenuBar In this article we are going to learn about Insert() function associated to wx.MenuBar class of wxPython. So Insert() function is a very important function in wx.MenuBar class. Insert() function Inserts the menu at the given position into the menu bar. Inserting menu at position 0 will insert it in 1 min read Like