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/wx.Listbox is a widget that consists of a scrolling box and a list ofitems. User can select one or more items from that list. It dependson whether it is created as a single or multiple selection box.Selected items are marked.listbox.py example consists of four different widgets. wx.Listbox,wx.TextCtrl, wx.StaticText and wx.Button. Widgets are organizedwith sizer-s. wx.Listbox has a list of six different world times.<strong>The</strong>se abbreviations are explained in the second wx.TextCtrl.Current time is displayed in the wx.StaticText widget. wx.Timerwidget is used to update the time every 100 miliseconds.Figure: listbox.py#!/usr/bin/python# listbox.pyimport wxfrom time import *class Listbox(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(550, 350))zone_list = ['CET', 'GMT', 'MSK', 'EST', 'PST', 'EDT']self.full_list = {'CET': 'Central European Time','GMT': 'Greenwich Mean Time','MSK': 'Moscow Time','EST': 'Eastern Standard Time','PST': 'Pacific Standard Time','EDT': 'Eastern Daylight Time'19 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!