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.

<strong>wxPython</strong> widgetshttp://www.zetcode.com/wxpython/widgets/RadioButtons(None, -1, 'radiobuttons.py')app.MainLoop()wx.Gaugewx.Gauge is a widget that is used, when we process lengthy tasks.wx.Gauge styleswx.GA_HORIZONTALwx.GA_VERTICALFigure: gauge.py# gauge.pyimport wxclass Gauge(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(300, 200))self.timer = wx.Timer(self, 1)self.count = 0self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer)panel = wx.Panel(self, -1)vbox = wx.BoxSizer(wx.VERTICAL)hbox1 = wx.BoxSizer(wx.HORIZONTAL)hbox2 = wx.BoxSizer(wx.HORIZONTAL)hbox3 = wx.BoxSizer(wx.HORIZONTAL)self.gauge = wx.Gauge(panel, -1, 50, size=(250, 25))self.btn1 = wx.Button(panel, wx.ID_OK)self.btn2 = wx.Button(panel, wx.ID_STOP)self.text = wx.StaticText(panel, -1, 'Task to be done')self.Bind(wx.EVT_BUTTON, self.OnOk, self.btn1)self.Bind(wx.EVT_BUTTON, self.OnStop, self.btn2)16 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!