13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Menus and Toolbars in <strong>wxPython</strong>http://www.zetcode.com/wxpython/menustoolbars/#!/usr/bin/python# dockable.pyimport wxclass Dockable(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title)menubar = wx.MenuBar(wx.MB_DOCKABLE)file = wx.Menu()edit = wx.Menu()view = wx.Menu()insr = wx.Menu()form = wx.Menu()tool = wx.Menu()help = wx.Menu()menubar.Append(file, '&File')menubar.Append(edit, '&Edit')menubar.Append(view, '&View')menubar.Append(insr, '&Insert')menubar.Append(form, '&Format')menubar.Append(tool, '&Tools')menubar.Append(help, '&Help')self.SetMenuBar(menubar)self.Centre()self.Show(True)app = wx.App()Dockable(None, -1, 'Dockable menubar')app.MainLoop()menubar = wx.MenuBar(wx.MB_DOCKABLE)We create a dockable menubar by providing a wx.MB_DOCKABLE flag tothe constructor.Figure: A dockable menubar3 de 15 27/04/2008 1:02

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!