wxPython - SetBitmap() function in wxPython Last Updated : 09 Jun, 2020 Comments Improve Suggest changes Like Article Like Report In this article we are going we are going to learn about SetBitmap() function associated with wx.MenuItem class of wxPython. SetBitmap() sets the bitmap for the menu item. SetBitmap must be called before the item is appended to the menu, i.e. appending the item without a bitmap and setting one later is not guaranteed to work. But the bitmap can be changed or reset later if it had been set up initially. Syntax: wx.SetBitmap Parameters: Parameter Input Type Description bmp wx.Bitmap Bitmap to set for menu item. checked bool True to check and False for uncheck. 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) self.menubar = wx.MenuBar() self.fileMenu = wx.Menu() self.item = wx.MenuItem(self.fileMenu, 1, '&Radio', helpString ="Check Help") # set bitmap for tool self.item.SetBitmap(bmp = wx.Bitmap('right.png'), checked = True) self.fileMenu.Append(self.item) self.menubar.Append(self.fileMenu, '&File') self.SetMenuBar(self.menubar) self.SetSize((350, 250)) self.SetTitle('Icons and shortcuts') 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 - SetBitmap() function in wxPython R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads Python - Move() function in wxPython In this particular article we will learn, how can we move our window to a particular point. This can be achieved using Move() function in wx.Window class of wxPython. Move() takes x and y points to move window to a particularx, y point. Syntax : wx.Move(self, x, y, flags=SIZE_USE_EXISTING) Parameter 1 min read wxPython | InsertSimpleTool() function in python 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 a 2 min read wxPython - SetBitmaps() function in wx.MenuItem In this article we are going to learn about SetBitmaps() function associated with the wx.MenuItem class of wxPython. SetBitmaps() function Sets the checked/unchecked bitmaps for the menu item. The first bitmap is also used as the single bitmap for uncheckable menu items. It takes two bitmaps as para 1 min read wxPython | GetToolBitmapSize() function in python In this article we are going to learn about GetToolBitmapSize() function of wxPython. GetToolBitmapSize() returns the size of bitmap that a toolbar expects to have. The default bitmap size is platform-dependent: for example, it is 16x15 for MSW and 24x24 for GTK. This size does not necessarily indic 2 min read wxPython - SetBitmapPosition() function in wx.Button In this article we are going to learn about SetBitmapPosition() function associated with wx.Button class of wxPython. SetBitmapPosition() function is used to set the direction of bitmap where you want to set. Directions: 1. wx.LEFT 2. wx.RIGHT 3. wx.BOTTOM 3. wx.TOP Syntax: wx.Button.SetBitmapPositi 1 min read Like