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/self.time.SetLabel(strftime("%H:%M:%S", print_time))app = wx.App()Listbox(None, -1, 'listbox.py')app.MainLoop()wx.SpinCtrlThis widget lets you increment and decrement a value. It has twoup and down arrow buttons for this purpose. User can enter avalue into a box or increment/decrement it by these two arrows.Converter script converts Fahrenheit temperature to Celsius. Thisexample is very popular and can be found in most programmingprimer books. So I made a <strong>wxPython</strong> example as well. wx.SpinCtrlstyleswx.SP_ARROW_KEYSwx.SP_WRAPFigure: converter.py#!/usr/bin/python# spinctrl.pyimport wxclass Converter(wx.Dialog):def __init__(self, parent, id, title):wx.Dialog.__init__(self, parent, id, title, size=(350, 310))21 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!