]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/demo/wxSpinButton.py
Fixes to avoid an endless event looping for wxGTK
[wxWidgets.git] / utils / wxPython / demo / wxSpinButton.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
3
4import string
5
6#----------------------------------------------------------------------
7
8class TestPanel(wxPanel):
9 def __init__(self, parent, log):
10 wxPanel.__init__(self, parent, -1)
11 self.log = log
12 self.count = 0
13
14 wxStaticText(self, -1, "This example uses the wxSpinButton control.",
15 wxPoint(45, 15))
16
17
18 self.text = wxTextCtrl(self, -1, "1", wxPoint(30, 50), wxSize(60, -1))
19 h = self.text.GetSize().height
b1462dfa
RD
20 self.spin = wxSpinButton(self, 20, wxPoint(92, 50), wxSize(h, h),
21 wxSP_VERTICAL)
cf694132
RD
22 self.spin.SetRange(1, 100)
23 self.spin.SetValue(1)
24
25 EVT_SPIN(self, 20, self.OnSpin)
26
27
28 def OnSpin(self, event):
29 self.text.SetValue(str(event.GetPosition()))
30
31
32#----------------------------------------------------------------------
33
34def runTest(frame, nb, log):
35 win = TestPanel(nb, log)
36 return win
37
38#----------------------------------------------------------------------
39
40
41
42
43
44
45
46
47
48
49overview = """\
50"""