summaryrefslogtreecommitdiffstats
path: root/doc/scriptexamples/label1.kvs
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 02:13:59 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 02:13:59 +0000
commita6d58bb6052ac8cb01805a48c4ad2f129126116f (patch)
treedd867a099fcbb263a8009a9fb22695b87855dad6 /doc/scriptexamples/label1.kvs
downloadkvirc-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/label1.kvs')
-rw-r--r--doc/scriptexamples/label1.kvs39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/scriptexamples/label1.kvs b/doc/scriptexamples/label1.kvs
new file mode 100644
index 00000000..d66cf154
--- /dev/null
+++ b/doc/scriptexamples/label1.kvs
@@ -0,0 +1,39 @@
+# A little label test.
+
+class(myLabel, label)
+{
+ constructor
+ {
+ $$->$setBackgroundColor(dcdc00);
+ $$->$setAutoResize(0);
+ $$->$setGeometry(10, 10, 500, 150);
+ $$->$setAlignment(Center);
+ $$->$setText("Come here !");
+ }
+
+ mouseEnterEvent
+ {
+ $$->$setMargin(10);
+ $$->$setAlignment(Right, Top);
+ %al = "My alignment is $$->$alignment(), and I have margin $$->$margin() pixels wide !";
+ $$->$setText(%al);
+ $$->$setFrameStyle(Panel, Raised);
+ echo "Label frame style: $$->$frameStyle()";
+ }
+
+ mouseLeaveEvent
+ {
+ $$->$setMargin(0);
+ $$->$setAlignment(Left, Bottom);
+ %al = "My alignment is $$->$alignment(), and I have margin $$->$margin() pixels wide !";
+ $$->$setText(%al);
+ $$->$setFrameStyle(Panel, Sunken);
+ echo "Label frame style: $$->$frameStyle()";
+ }
+}
+
+%w = $new(widget, 0);
+%w->$resize(520, 170);
+%w->$move(50, 50);
+%l = $new(myLabel, %w);
+%w->$show();