wxPython | GetToolBitmapSize() function in python Last Updated : 09 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 indicate the best size to use for the toolbars on the given platform, for this you should use ArtProvider::GetNativeSizeHint(wxART_TOOLBAR) but in any case, as the bitmap size is deduced automatically from the size of the bitmaps associated with the tools added to the toolbar, it is usually unnecessary to call SetToolBitmapSize explicitly. Syntax: wx.ToolBar.GetToolBitmapSize(self) Parameters : No Parameters in GetToolBitmapSize() function. Return Type: wx.Size Code Example: Python3 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() self.toolbar.SetMargins(10, 10) # Add Tools Using AddTool function rtool = self.toolbar.AddTool(13, 'twoTool', wx.Bitmap('wrong.png'), shortHelp ="Simple Tool2") stool = self.toolbar.AddTool(14, 'twoTool', wx.Bitmap('wrong.png'), shortHelp ="Simple Tool") self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() # print tool bitmap size print(self.toolbar.GetToolBitmapSize()) def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output : (32, 32) Code Example 2: Python3 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() self.toolbar.SetMargins(10, 10) # Add Tools Using AddTool function rtool = self.toolbar.AddTool(13, 'twoTool', wx.Bitmap('user.png'), shortHelp ="Simple Tool2") self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() # print tool bitmap size print(self.toolbar.GetToolBitmapSize()) def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output: (24, 24) Comment More infoAdvertise with us Next Article wxPython | GetToolPacking() function in python R RahulSabharwal Follow Improve Article Tags : Python Python-wxPython Practice Tags : python Similar Reads 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 | 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 | GetToolPacking() function in python In this article we are going to learn about GetToolPacking() function associated with wx.ToolBar class of wxPython. GetToolPacking() function simply returns the value used for packing tools.The packing is used for spacing in the vertical direction if the toolbar is horizontal, and for spacing in the 2 min read wxPython | GetToolEnabled() function in python In this article we are going to learn about GetToolEnabled() function present in class wx.ToolBar of wxPython. GetToolEnabled() function simply returns a pointer to the tool at particular position. It takes only single argument that is pos(position of tool starting from 0). Syntax : wx.ToolBar.GetTo 2 min read wxPython | GetMargins() function in python In this article we are going to learn about GetMargins() function of class wx.ToolBar in wxPython. GetMargins() function returns the left/right and top/bottom margins, which are also used for inter-toolspacing. GetMargins takes no parameters. Syntax: wx.ToolBar.GetMargins(self) Parameters: No Parame 2 min read wxPython - SetToolBitmapSize() function in wx.ToolBar In this article we are going to learn about SetToolBitMapSize() function associated with the wx.ToolBar class of wxPython. Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels. It takes only size as parameter. Syntax: wx.ToolBar.SetToolBitmapSize(self, size) Paramete 2 min read Like