13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>wxPython</strong> widgetshttp://www.zetcode.com/wxpython/widgets/self.cb = wx.CheckBox(panel, -1, 'Show Title', (10, 10))self.cb.SetValue(True)wx.EVT_CHECKBOX(self, self.cb.GetId(), self.ShowTitle)self.Show()self.Centre()def ShowTitle(self, event):if self.cb.GetValue():self.SetTitle('checkbox.py')else: self.SetTitle('')app = wx.App()CheckBox(None, -1, 'checkbox.py')app.MainLoop()wx.StatusBarAs it's name indicates, the wx.StatusBar widget is used to displayapplication status information. It can be divided into several partsto show different kind of information. We can insert other widgetsinto the wx.StatusBar. It can be used as an alternative to dialogs,since dialogs are ofted abused and they are disliked by most users.We can create a wx.StatusBar in two ways. We can manuallycreate our own wx.StatusBar and call SetStatusBar() method orwe can simply call the CreateStatusBar() method. <strong>The</strong> lattermethod creates a default wx.StatusBar for us. In our example, wehave a wx.Frame widget and five other widgets. If we hover amouse pointer over a widget, it's description is shown on thewx.StatusBarFigure: statusbar.py#!/usr/bin/python# statusbar.py13 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!