summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/setIncomingData/1.py
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/setIncomingData/1.py
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/setIncomingData/1.py')
-rw-r--r--superkaramba/examples/setIncomingData/1.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/superkaramba/examples/setIncomingData/1.py b/superkaramba/examples/setIncomingData/1.py
new file mode 100644
index 0000000..8422de2
--- /dev/null
+++ b/superkaramba/examples/setIncomingData/1.py
@@ -0,0 +1,27 @@
+import karamba
+
+sequence_num = 0
+
+def initWidget(widget):
+ karamba.openTheme('2.theme')
+
+# pass over a sequence number as well - the reason is to
+# make it possible to identify the clicks uniquely.
+#
+# unfortunately, the recipient has to do "polling"
+# by calling getIncomingData - see 2.py for more info
+
+def widgetClicked(widget, x, y, button):
+
+ # do as you wish, but this is a good way:
+ # compact your stuff with repr() it can cope
+ # with pretty much any basic types - dictionaries, lists -
+ # and then use eval() at the other end.
+
+ global sequence_num
+ sequence_num += 1
+
+ vars = (sequence_num, x, y, button)
+ message = repr(vars)
+ karamba.setIncomingData(widget, "2", message)
+