In this article we are going to learn about GetToolSeparation() function associated with wx.ToolBar class of wxPython. GetToolSeparation() function returns the default separator size. GetToolSeparation() function takes no arguments.
Syntax :
wx.ToolBar.GetToolSeparation(self)Parameters :
GetToolSeparation() function takes no arguments.Returns:
Returns the default separator size.Return Type:
int
Example #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) pnl = wx.Panel(self) self.toolbar = self.CreateToolBar() # Add Tools Using AddTool function rtool = self.toolbar.AddLabelTool(id = 13, label = "Tool one", bitmap = wx.Bitmap('right.png'), shortHelp ="short help 1", longHelp = "Long help associated with simple tool 1") stool = self.toolbar.AddLabelTool(id = 14, label = "Tool two", bitmap = wx.Bitmap('wrong.png'), shortHelp ="short help 2", longHelp = "Long help associated with simple tool 2") self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() # print tool separation value print(self.toolbar.GetToolSeparation()) def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() |
chevron_right
filter_none
Output:
0
Example #2:
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) pnl = wx.Panel(self) self.toolbar = self.CreateToolBar() self.toolbar.SetToolSeparation(12) # Add Tools Using AddTool function rtool = self.toolbar.AddLabelTool(id = 13, label = "Tool one", bitmap = wx.Bitmap('right.png'), shortHelp ="short help 1", longHelp = "Long help associated with simple tool 1") stool = self.toolbar.AddLabelTool(id = 14, label = "Tool two", bitmap = wx.Bitmap('wrong.png'), shortHelp ="short help 2", longHelp = "Long help associated with simple tool 2") self.toolbar.Realize() self.SetSize((350, 250)) self.SetTitle('Control') self.Centre() # print tool separation value print(self.toolbar.GetToolSeparation()) def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() |
chevron_right
filter_none
Output:
12
Recommended Posts:
- wxPython - Replace() function in wxPython
- wxPython | EnableTool() function in wxPython
- wxPython - GetLabelText() function in wxPython
- wxPython - SetBitmap() function in wxPython
- wxPython - GetBatteryState() function in wxPython
- wxPython | Exit() function in wxPython
- wxPython - wx.DisplaySizeMM() function in wxPython
- wxPython - Disable statictext in wxPython
- wxPython - GetField() function function in wx.StatusBar
- Python - Move() function in wxPython
- Python - Create() function in wxPython
- wxPython - SetLabel() function in wx.MenuBar
- wxPython - GetHelpString() function in wx.MenuBar
- wxPython - SetHelpString() function in wx.MenuBar
- wxPython - FindMenuItem() function in wx.MenuBar
- wxPython - GetMenuLabelText() function in wx.MenuBar
- wxPython - GetMenuLabel() function in wx.MenuBar
- wxPython - GetMeuCount() function in wx.MenuBar
- wxPython - GetLabel() function in wx.MenuBar
- wxPython - Remove() function in wx.MenuBar
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

