wxWidgets/wxPython/demo/wxChoice.py
Robin Dunn 8577c05a58 updated version number
fixed a sample


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-07-04 23:34:51 +00:00

49 lines
1.2 KiB
Python

from wxPython.wx import *
#---------------------------------------------------------------------------
class TestChoice(wxPanel):
def __init__(self, parent, log):
self.log = log
wxPanel.__init__(self, parent, -1)
sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight']
wxStaticText(self, -1, "This example uses the wxChoice control.",
wxPoint(15, 10))
wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(75, 20))
self.ch = wxChoice(self, 40, (80, 50), choices = sampleList)
EVT_CHOICE(self, 40, self.EvtChoice)
def EvtChoice(self, event):
self.log.WriteText('EvtChoice: %s\n' % event.GetString())
self.ch.Append("A new item")
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestChoice(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
A choice item is used to select one of a list of strings. Unlike a listbox, only the selection is visible until the user pulls down the menu of choices.
"""