wxPython - Change cursor for ToolBar Last Updated : 26 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In this article will learn how can we change the cursor to a custom image cursor when it hovers over the toolbar. To do this we need to follow some steps as follows. Step 1: Create wx.Image object of the image you like. Step 2: Create wx.Cursor object passing image as parameter. Step 3: Set cursor for toolbar using SetCursor() method. Syntax: wx.ToolBar.SetCursor(self, cursor) Parameters: Parameter Input Type Description size wx.Size Size for radio button Return Type: bool Code Example: Python3 1== 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): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) pnl = wx.Panel(self) self.toolbar = self.CreateToolBar() # Add tools to toolbar ptool = self.toolbar.AddTool(12, 'oneTool', wx.Bitmap('right.png'), wx.Bitmap('wrong.png'), shortHelp ="Simple Tool") qtool = self.toolbar.AddTool(12, 'oneTool', wx.Bitmap('wrong.png'), wx.Bitmap('wrong.png'), shortHelp ="Simple Tool") # create wx.Image object img = wx.Image('click.png') # create wx.Cursor object crsr = wx.Cursor(img) # set crsr cursor for the toolbar self.toolbar.SetCursor(crsr) self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output Window: Comment More infoAdvertise with us Next Article wxPython - Change cursor for ToolBar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - change toolbar colour wx.ToolBar In this article we are going to learn to change the colour of toolbar. We will simply use SetBackgroundColour() function in order to do this. SetBackgroundColour() simply sets the background colour of the window. It takes a wx.Colour parameter, i.e., the colour to be used as the background colour. S 1 min read wxPython - Change Cursor on hover on Button In this article we will learn that how can we change cursor when it hovers on Button present in frame. We need to follow some steps as followed. Step 1- Create a wx.Image object with image you want to use as cursor image. Step 2- Create a wx.Cursor object and pass wx.Image object above created. Step 1 min read wxPython - Change Cursor image on StaticText In this article we will learn how can we change cursor image when cursor hovers over the static text. We can do it by creating a cursor object and using SetCursor() function associated with wx.StaticText class of wxPython. SetCursor() takes wx.Cursor object as a parameter. Syntax: wx.StaticText.SetC 1 min read wxPython - Hide toolbar from frame In this article we are going to learn that how can we hide toolbar present in the frame. In order to do that we will be using Hide() function. Hide() function simply hides the Toolbar window and not delete it like Drop() function. Hidden toolbar can be shown again using Show() function. Syntax: wx.T 1 min read wxPython - Get background colour of Toolbar In this article we will know how can we get the colour of the background of wx.ToolBar. In order to do this we will use GetBackgroundColour() function of wxPython. GetBackgroundColour() function simply returns the background colour of the window. Syntax: wx.ToolBar.GetBackgroundColour(self) Paramete 1 min read Like