1fded56b37
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
59 lines
1.3 KiB
Python
59 lines
1.3 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.
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
import sys,os
|
|
import run
|
|
run.main(['', os.path.basename(sys.argv[0])])
|
|
|