summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/control_management
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch)
tree8d927b7b47a90c4adb646482a52613f58acd6f8c /superkaramba/examples/control_management
downloadtdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz
tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'superkaramba/examples/control_management')
-rw-r--r--superkaramba/examples/control_management/mgmt.py49
-rw-r--r--superkaramba/examples/control_management/mgmt.theme1
2 files changed, 50 insertions, 0 deletions
diff --git a/superkaramba/examples/control_management/mgmt.py b/superkaramba/examples/control_management/mgmt.py
new file mode 100644
index 0000000..eae98c2
--- /dev/null
+++ b/superkaramba/examples/control_management/mgmt.py
@@ -0,0 +1,49 @@
+#
+# Written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+
+#this import statement allows access to the karamba functions
+import karamba
+
+do_nothing_txt = None
+mgmt_txt = None
+
+
+#this is called when you widget is initialized
+def initWidget(widget):
+ global do_nothing_txt
+ global do_something_txt
+
+ # display new message
+ do_nothing_txt = karamba.createText(widget, 0, 00, 300, 20,
+ "Right mouse click me!")
+ karamba.changeTextColor(widget, do_nothing_txt, 252,252,252)
+ mgmt_txt = karamba.createText(widget, 0, 20, 300, 20,
+ "Righ mouse click me too!")
+ karamba.changeTextColor(widget, mgmt_txt, 252,252,252)
+
+ karamba.redrawWidget(widget)
+
+ karamba.setWantRightButton(widget, 1)
+
+def widgetUpdated(widget):
+ karamba.redrawWidget(widget)
+
+def widgetClicked(widget, x, y, button):
+ global do_nothing_txt
+
+ if y < 20:
+ if do_nothing_txt is not None:
+ karamba.deleteText(widget, do_nothing_txt)
+ do_nothing_txt = karamba.createText(widget,
+ 0, 0, 300, 20, "I don't do anything when clicking here.")
+ karamba.changeTextColor(widget, do_nothing_txt,
+ 255,200,200)
+ karamba.redrawWidget(widget)
+ return
+
+ karamba.managementPopup(widget)
+
+
+# This will be printed when the widget loads.
+print "Loaded my python extension!"
+
diff --git a/superkaramba/examples/control_management/mgmt.theme b/superkaramba/examples/control_management/mgmt.theme
new file mode 100644
index 0000000..f54c88f
--- /dev/null
+++ b/superkaramba/examples/control_management/mgmt.theme
@@ -0,0 +1 @@
+KARAMBA x=200 y=100 w=300 h=40 INTERVAL=200 LOCKED=true