]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/tests/getvalues.py
1 from wxPython
.wx
import *
4 def __init__(self
, parent
):
5 wxDialog
.__init
__(self
, parent
, -1, "This is a test",
6 wxDefaultPosition
, wxSize(150, 150))
8 self
.text1
= wxTextCtrl(self
, -1, "", wxPoint(10, 10), wxSize(120, -1))
9 self
.text2
= wxTextCtrl(self
, -1, "", wxPoint(10, 40), wxSize(120, -1))
11 wxButton(self
, wxID_OK
, "Okay", wxPoint(10,70)).SetDefault()
12 wxButton(self
, wxID_CANCEL
, "Cancel", wxPoint(60, 70))
16 val1
= self
.text1
.GetValue()
17 val2
= self
.text2
.GetValue()
26 frame
= wxFrame(NULL
, -1, "")
27 wxButton(frame
, 101, "test it", wxDefaultPosition
, wxSize(50, 25))
28 EVT_BUTTON(frame
, 101, self
.OnClick
)
32 self
.SetTopWindow(frame
)
35 def OnClick(self
, event
):
37 if dlg
.ShowModal() == wxID_OK
:
38 values
= dlg
.GetValues()
39 print "Your values are: %s" % str(values
)