wxPython - Add Image in Button Last Updated : 24 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In this article we are going to learn that, how can we add image in a button. So first of all we will create a wx.Bitmap object and initialize with the image we want to add to button. After this we will use SetBitmap() function associated with wx.Button class of wxPython. SetBitmap() function takes wx.Bitmap object as parameter. Syntax: wx.Button.SetBitmap(self, bitmap) Parameters: Parameter Input Type Description bitmap wx.Bitmap Bitmap set for button. Code Example: Python3 1== 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) # create parent panel for button self.pnl = wx.Panel(self) # create wx.Bitmap object bmp = wx.Bitmap('pointer.png') # create button at point (20, 20) self.st = wx.Button(self.pnl, id = 1, label ="Button", pos =(20, 20), size =(100, 30), name ="button") # set bmp as bitmap for button self.st.SetBitmap(bmp) self.SetSize((350, 250)) self.SetTitle('wx.Button') 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 - Add Image in Button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-Button Practice Tags : python Similar Reads Python | Add image on a Tkinter button Tkinter is a Python module which is used to create GUI (Graphical User Interface) applications with the help of varieties of widgets and functions. Like any other GUI module it also supports images i.e you can use images in the application to make it more attractive. Image can be added with the help 3 min read wxPython - Image on button in Python In this particular article we will learn how can we add image to a button in GUI using wxPython. This can be achieved using BitmapButton() constructor of wx.BitmapButton class in wx. Following Window Styles are supported : wx.BU_LEFT: Left-justifies the bitmap label.wx.BU_TOP: Aligns the bitmap labe 1 min read wxPython - Disable Button In this article we are going to learn about how can we disable a button present in a frame. Sometimes when we dont want user to press a button we can disable a button and the button become unclickable. In order to disable a button we can use Disable() function associated with wx.Button class of wxPy 1 min read Button in wxPython - Python In this article we are going to learn how can we add buttons to a frame in wxPython. This can be done by using the Button() constructor of wx.Button class. Following styles are supported in this class: wx.BU_LEFT: Left-justifies the label. Windows and GTK+ only.wx.BU_TOP: Aligns the label to the top 2 min read wxPython - change size of Button In this article we are going to learn about SetSize() function associated with wx.Button class of wxPython. SetSize() function is simply used to change the size of the button present in the frame. SetSize function takes a wxSize argument to change the size of button. Syntax: wx.Button.SetSize(self, 1 min read Like