diff options
Diffstat (limited to 'doc/scriptexamples/widget2.kvs')
-rw-r--r-- | doc/scriptexamples/widget2.kvs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/scriptexamples/widget2.kvs b/doc/scriptexamples/widget2.kvs new file mode 100644 index 00000000..8c9b5b7a --- /dev/null +++ b/doc/scriptexamples/widget2.kvs @@ -0,0 +1,23 @@ +# a stupid game :) (version 2) + +class(mystupidgame,widget) +{ + constructor + { + srand $unixTime; + $$->$setCaption(":)"); + $$->$setGeometry($rand(770),$rand(570),30,30); + } + mouseEnterEvent + { + $$->$move($rand(770),$rand(570)); + } + mousePressEvent + { + echo "You got me!" + delete $$ + } +} + +%w = $new(mystupidgame,0) +%w->$show() |