]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/wxSpinButton.py
2 from wxPython
.wx
import *
6 #----------------------------------------------------------------------
8 class TestPanel(wxPanel
):
9 def __init__(self
, parent
, log
):
10 wxPanel
.__init
__(self
, parent
, -1)
14 wxStaticText(self
, -1, "This example uses the wxSpinButton control.",
18 self
.text
= wxTextCtrl(self
, -1, "1", wxPoint(30, 50), wxSize(60, -1))
19 h
= self
.text
.GetSize().height
20 self
.spin
= wxSpinButton(self
, 20, wxPoint(92, 50), wxSize(h
*2, h
))
21 self
.spin
.SetRange(1, 100)
24 EVT_SPIN(self
, 20, self
.OnSpin
)
27 def OnSpin(self
, event
):
28 self
.text
.SetValue(str(event
.GetPosition()))
31 #----------------------------------------------------------------------
33 def runTest(frame
, nb
, log
):
34 win
= TestPanel(nb
, log
)
37 #----------------------------------------------------------------------