APLX Help : System Classes : List of Classes : Timer
|
|
![]() |
Timer |
DescriptionThe Timer class implements a periodic timer. This is an invisible object, which calls the onTimer callback at a fixed interval (provided the object's enabled property is 1). The time interval is set by the interval property, and is expressed in milliseconds. A Timer object can be a top-level object (created directly using Example∇DEMO_Timer;CB_TIMER;DEMO [1] ⍝ Sample function demonstrating use of the Timer object [2] DEMO←'⎕' ⎕NEW 'Window' [3] DEMO.where←4 4 ⋄ DEMO.scale←1 ⋄ DEMO.size←7 30 [4] DEMO.title←'Timer Example' [5] DEMO.myLabel.New 'Label' ⋄ DEMO.myLabel.where←2 1 [6] DEMO.myLabel.caption←'' [7] ⍝ Set up 1-second timer which updates the label text [8] DEMO.myTimer.New 'Timer' ⋄ DEMO.myTimer.interval←1000 [9] ⍝ Create a little callback function which will run once a second [10] 0 0⍴⎕FX 'CB_TIMER' 'DEMO.myLabel.caption←⎕TIME' [11] DEMO.myTimer.onTimer←'CB_TIMER' [12] ⍝ [13] ⍝ Wait for the user to close the window [14] 0 0⍴1 ⎕WE DEMO ∇ Propertieschildren class data enabled events interval methods name opened properties self tie MethodsClose Create Delete New Open Send Set Trigger CallbacksonClose onDestroy onOpen onSend onTimer |
|
APLX Help : System Classes : List of Classes : Timer
|
Copyright © 1996-2010 MicroAPL Ltd