summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/widget1.kvs
diff options
context:
space:
mode:
Diffstat (limited to 'doc/scriptexamples/widget1.kvs')
-rw-r--r--doc/scriptexamples/widget1.kvs20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/scriptexamples/widget1.kvs b/doc/scriptexamples/widget1.kvs
new file mode 100644
index 0000000..21511b3
--- /dev/null
+++ b/doc/scriptexamples/widget1.kvs
@@ -0,0 +1,20 @@
+# a stupid game :)
+
+srand $unixTime
+
+%w = $new(widget,0,mywidget)
+%w->$setCaption(":)");
+%w->$setGeometry($rand(770),$rand(570),30,30);
+
+privateimpl(%w,mouseEnterEvent)
+{
+ $$->$move($rand(770),$rand(570));
+}
+
+privateimpl(%w,mousePressEvent)
+{
+ echo "You got me!"
+ delete $$
+}
+
+%w->$show()