]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxLEDNumberCtrl.py
fix text scrolling in GTK2 (patch 703988)
[wxWidgets.git] / wxPython / demo / wxLEDNumberCtrl.py
CommitLineData
950e7faf
RD
1
2from wxPython.wx import *
3from wxPython.gizmos import *
4
5import time
6
7#----------------------------------------------------------------------
8
9class TestPanel(wxPanel):
10 def __init__(self, parent, log):
11 wxPanel.__init__(self, parent, -1)
12 self.log = log
13
14 led = wxLEDNumberCtrl(self, -1, (25,25), (280, 50))
52ad59c2 15 led.SetValue("01234")
950e7faf
RD
16
17 led = wxLEDNumberCtrl(self, -1, (25,100), (280, 50))
52ad59c2 18 led.SetValue("56789")
950e7faf 19 led.SetAlignment(wxLED_ALIGN_RIGHT)
1e4a197e 20 led.SetDrawFaded(False)
950e7faf
RD
21
22 led = wxLEDNumberCtrl(self, -1, (25,175), (280, 50),
23 wxLED_ALIGN_CENTER)# | wxLED_DRAW_FADED)
24 self.clock = led
25 self.OnTimer(None)
26
27 self.timer = wxTimer(self)
28 self.timer.Start(1000)
29 EVT_TIMER(self, -1, self.OnTimer)
30
31
32 def OnTimer(self, evt):
33 t = time.localtime(time.time())
34 st = time.strftime("%I-%M-%S", t)
35 self.clock.SetValue(st)
36
37
38
39#----------------------------------------------------------------------
40
41def runTest(frame, nb, log):
42 win = TestPanel(nb, log)
43 return win
44
45#----------------------------------------------------------------------
46
47overview = """\
48"""
1fded56b
RD
49
50
51
52if __name__ == '__main__':
53 import sys,os
54 import run
55 run.main(['', os.path.basename(sys.argv[0])])
56