diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 02:13:59 +0000 |
commit | a6d58bb6052ac8cb01805a48c4ad2f129126116f (patch) | |
tree | dd867a099fcbb263a8009a9fb22695b87855dad6 /doc/scriptexamples/timer1.kvs | |
download | kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.tar.gz kvirc-a6d58bb6052ac8cb01805a48c4ad2f129126116f.zip |
Added KDE3 version of kvirc
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'doc/scriptexamples/timer1.kvs')
-rw-r--r-- | doc/scriptexamples/timer1.kvs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/scriptexamples/timer1.kvs b/doc/scriptexamples/timer1.kvs new file mode 100644 index 00000000..b123c6b7 --- /dev/null +++ b/doc/scriptexamples/timer1.kvs @@ -0,0 +1,25 @@ +# This is a simple example of using the builtin object timer +# capabilities. + +# we create a new object +%bomb = $new(object,0,myobject) + +# implement its timerEvent +privateimpl(%bomb,timerEvent) +{ + if($$->%secsToGo > 0) + { + echo "Countdown: $$->%secsToGo" + $$->%secsToGo--; + } else { + echo "Boom!" + delete $this + } +} + +# and trigger it +echo "Countdown: 10 seconds to go" +%bomb->%secsToGo = 9 +%bomb->$startTimer(1000) + +# now just have to wait... |