]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/tests/spies2.py
1 from wxPython
.wx
import *
3 #---------------------------------------------------------------------------
5 class TestComboBox(wxDialog
):
6 def __init__(self
, parent
):
8 wxDialog
.__init
__(self
, parent
, -1, "This is a test",
9 wxDefaultPosition
, wxSize(550, 250))
10 self
.s
= ['aaaaaaaaaaaaaa',
12 'cccccccccccccccccccccccccccccccccccc',
16 'gggggggggggggggggggggggg',
21 wxStaticText(self
, -1, "This example uses the wxListBox control.",
24 wxStaticText(self
, -1, "Select one:", wxPoint(15, 50), wxSize(65, -1))
27 self
.lb
= wxComboBox(self
, 50, dv
, wxPoint(80, 50), wxSize(xwaarde
, -1),
28 self
.s
, wxCB_DROPDOWN
)
30 wxButton(self
, wxID_OK
, "Okay", wxPoint(10,90)).SetDefault()
31 wxButton(self
, wxID_CANCEL
, "Cancel", wxPoint(60, 90))
34 def GetSelection(self
,leer
):
36 val1
= self
.lb
.GetStringSelection()
45 frame
= wxFrame(NULL
, -1, "")
46 wxButton(frame
, 101, "test it", wxDefaultPosition
, wxSize(50, 25))
47 EVT_BUTTON(frame
, 101, self
.OnClick
)
51 self
.SetTopWindow(frame
)
54 def OnClick(self
, event
):
56 dlg
= TestComboBox(NULL
)
58 if dlg
.ShowModal() == wxID_OK
:
59 values
= dlg
.GetSelection(NULL
)
60 print "Your values are: %s" % str(values
)