Skip to content

Instantly share code, notes, and snippets.

@Bouke

Bouke/gist:4110867

Created Nov 19, 2012
Embed
What would you like to do?
OSX-like toolbar wxpython
import wx
class DemoFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Somewhat Native OSX Toolbar", size=(700,400))
self.toolbar = self.CreateToolBar(wx.TB_FLAT | wx.TB_TEXT)
self.toolbar.AddLabelTool(wx.ID_NEW, 'Label', wx.Bitmap('wrench.png'))
self.toolbar.AddCheckLabelTool(wx.ID_NEW, 'Check', wx.Bitmap('wrench.png'))
self.toolbar.AddRadioLabelTool(wx.ID_NEW, 'Radio 1', wx.Bitmap('wrench.png'))
self.toolbar.AddRadioLabelTool(wx.ID_NEW, 'Radio 2', wx.Bitmap('wrench.png'))
self.toolbar.AddSeparator()
search = wx.SearchCtrl(self.toolbar)
self.toolbar.AddControl(search)
self.toolbar.Realize()
self.Layout()
self.Show()
if __name__ == "__main__":
app = wx.App()
frame = DemoFrame()
app.MainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.