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.ComboBox(int id, string value='', wx.Point pos=wx.DefaultPosition, wx.Size size=wwx.List choices=wx.EmptyList, int style=0, wx.Validator validator=wx.DefaultValidstring name=wx.ComboBoxNameStr)wx.ComboBox styleswx.CB_DROPDOWNwx.CB_READONLYwx.CB_SORTFigure: combobox.py#!/usr/bin/python# combobox.pyimport wxclass ComboBox(wx.Dialog):def __init__(self, parent, id, title):wx.Dialog.__init__(self, parent, id, title, size=(250, 270))panel = wx.Panel(self, -1, (75, 20), (100, 127), style=wx.SUNKEN_BORDER)self.picture = wx.StaticBitmap(panel)panel.SetBackgroundColour(wx.WHITE)self.images = ['tolstoy.jpg', 'feuchtwanger.jpg', 'balzac.jpg', 'pasternak.'galsworthy.jpg', 'wolfe.jpg', 'zweig.jpg']authors = ['Leo Tolstoy', 'Lion Feuchtwanger', 'Honore de Balzac','Boris Pasternak', 'John Galsworthy', 'Tom Wolfe', 'Stefan Zweig']wx.ComboBox(self, -1, pos=(50, 170), size=(150, -1), choices=authors,style=wx.CB_READONLY)wx.Button(self, 1, 'Close', (80, 220))11 de 29 27/04/2008 1:04

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

Saved successfully!

Ooh no, something went wrong!