2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 class TestChoice(wxPanel
):
7 def __init__(self
, parent
, log
):
9 wxPanel
.__init
__(self
, parent
, -1)
11 sampleList
= ['zero', 'one', 'two', 'three', 'four', 'five',
12 'six', 'seven', 'eight']
14 wxStaticText(self
, -1, "This example uses the wxChoice control.",
17 wxStaticText(self
, -1, "Select one:", wxPoint(15, 50), wxSize(75, 20))
18 wxChoice(self
, 40, (80, 50), (95, 125),
20 EVT_CHOICE(self
, 40, self
.EvtChoice
)
22 def EvtChoice(self
, event
):
23 self
.log
.WriteText('EvtChoice: %s\n' % event
.GetString())
25 #---------------------------------------------------------------------------
27 def runTest(frame
, nb
, log
):
28 win
= TestChoice(nb
, log
)
31 #---------------------------------------------------------------------------
45 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.