]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxLEDNumberCtrl.py
   2 from wxPython
.wx 
import * 
   3 from wxPython
.gizmos 
import * 
   7 #---------------------------------------------------------------------- 
   9 class TestPanel(wxPanel
): 
  10     def __init__(self
, parent
, log
): 
  11         wxPanel
.__init
__(self
, parent
, -1) 
  14         led 
= wxLEDNumberCtrl(self
, -1, (25,25), (280, 50)) 
  17         led 
= wxLEDNumberCtrl(self
, -1, (25,100), (280, 50)) 
  19         led
.SetAlignment(wxLED_ALIGN_RIGHT
) 
  20         led
.SetDrawFaded(false
) 
  22         led 
= wxLEDNumberCtrl(self
, -1, (25,175), (280, 50), 
  23                               wxLED_ALIGN_CENTER
)# | wxLED_DRAW_FADED) 
  27         self
.timer 
= wxTimer(self
) 
  28         self
.timer
.Start(1000) 
  29         EVT_TIMER(self
, -1, self
.OnTimer
) 
  32     def OnTimer(self
, evt
): 
  33         t 
= time
.localtime(time
.time()) 
  34         st 
= time
.strftime("%I-%M-%S", t
) 
  35         self
.clock
.SetValue(st
) 
  39 #---------------------------------------------------------------------- 
  41 def runTest(frame
, nb
, log
): 
  42     win 
= TestPanel(nb
, log
) 
  45 #----------------------------------------------------------------------