]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxSpinButton.py
2 from wxPython
.wx
import *
4 #----------------------------------------------------------------------
6 class TestPanel(wxPanel
):
7 def __init__(self
, parent
, log
):
8 wxPanel
.__init
__(self
, parent
, -1)
12 wxStaticText(self
, -1, "This example uses the wxSpinButton control.",
16 self
.text
= wxTextCtrl(self
, -1, "1", wxPoint(30, 50), wxSize(60, -1))
17 h
= self
.text
.GetSize().height
18 self
.spin
= wxSpinButton(self
, 20, wxPoint(92, 50), wxSize(h
, h
),
20 self
.spin
.SetRange(1, 100)
23 EVT_SPIN(self
, 20, self
.OnSpin
)
26 def OnSpin(self
, event
):
27 self
.text
.SetValue(str(event
.GetPosition()))
30 #----------------------------------------------------------------------
32 def runTest(frame
, nb
, log
):
33 win
= TestPanel(nb
, log
)
36 #----------------------------------------------------------------------
52 if __name__
== '__main__':
55 run
.main(['', os
.path
.basename(sys
.argv
[0])])