1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
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))
|
2001-07-04 23:34:51 +00:00
|
|
|
self.ch = wxChoice(self, 40, (80, 50), choices = sampleList)
|
1999-04-30 03:29:54 +00:00
|
|
|
EVT_CHOICE(self, 40, self.EvtChoice)
|
|
|
|
|
2001-06-15 21:43:26 +00:00
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
def EvtChoice(self, event):
|
|
|
|
self.log.WriteText('EvtChoice: %s\n' % event.GetString())
|
2001-06-15 21:43:26 +00:00
|
|
|
self.ch.Append("A new item")
|
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
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.
|
|
|
|
"""
|