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/toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/rectangle.gif'))toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/ellipse.gif'))toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/qs.gif'))toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/text.gif'))toolbar.Realize()self.Centre()self.Show(True)def OnExit(self, event):self.Close()app = wx.App()VerticalToolbar(None, -1, 'vertical toolbar')app.MainLoop()toolbar = self.CreateToolBar(wx.TB_VERTICAL)Here we create a vertical toolbar.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/select.gif'))toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('../icons/freehand.gif'))...I have borrowed icons from the Xara Xtreme graphics application.Figure: vertical toolbarIn the following example, we will show, how we can enable and disabletoolbar buttons. We will also see a separator line.#!/usr/bin/python13 de 15 27/04/2008 1:02

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

Saved successfully!

Ooh no, something went wrong!