]>
git.saurik.com Git - wxWidgets.git/blob - 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
, h
), 
  22         self
.spin
.SetRange(1, 100) 
  25         EVT_SPIN(self
, 20, self
.OnSpin
) 
  28     def OnSpin(self
, event
): 
  29         self
.text
.SetValue(str(event
.GetPosition())) 
  32 #---------------------------------------------------------------------- 
  34 def runTest(frame
, nb
, log
): 
  35     win 
= TestPanel(nb
, log
) 
  38 #----------------------------------------------------------------------