]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxSpinButton.py
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / demo / wxSpinButton.py
1
2 from wxPython.wx import *
3
4 #----------------------------------------------------------------------
5
6 class TestPanel(wxPanel):
7 def __init__(self, parent, log):
8 wxPanel.__init__(self, parent, -1)
9 self.log = log
10 self.count = 0
11
12 wxStaticText(self, -1, "This example uses the wxSpinButton control.",
13 wxPoint(45, 15))
14
15
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),
19 wxSP_VERTICAL)
20 self.spin.SetRange(1, 100)
21 self.spin.SetValue(1)
22
23 EVT_SPIN(self, 20, self.OnSpin)
24
25
26 def OnSpin(self, event):
27 self.text.SetValue(str(event.GetPosition()))
28
29
30 #----------------------------------------------------------------------
31
32 def runTest(frame, nb, log):
33 win = TestPanel(nb, log)
34 return win
35
36 #----------------------------------------------------------------------
37
38
39
40
41
42
43
44
45
46
47 overview = """\
48 """
49
50
51
52 if __name__ == '__main__':
53 import sys,os
54 import run
55 run.main(['', os.path.basename(sys.argv[0])])