summaryrefslogtreecommitdiffstats
path: root/superkaramba/examples/control_management/mgmt.py
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-11-11 17:41:30 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-11-13 12:09:49 +0900
commitda9cd0c056c8275033fca84a1c8d49a8edb0c8ee (patch)
tree2521f74c0b2868d82518e13053fb01cc179e9a23 /superkaramba/examples/control_management/mgmt.py
parent5dab6232ef3b3715630cf88eb40c4c6021e65f07 (diff)
downloadtdeutils-da9cd0c056c8275033fca84a1c8d49a8edb0c8ee.tar.gz
tdeutils-da9cd0c056c8275033fca84a1c8d49a8edb0c8ee.zip
superkaramba: convert examples to python3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'superkaramba/examples/control_management/mgmt.py')
-rw-r--r--superkaramba/examples/control_management/mgmt.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/superkaramba/examples/control_management/mgmt.py b/superkaramba/examples/control_management/mgmt.py
index eae98c2..2e43634 100644
--- a/superkaramba/examples/control_management/mgmt.py
+++ b/superkaramba/examples/control_management/mgmt.py
@@ -10,40 +10,40 @@ mgmt_txt = None
#this is called when you widget is initialized
def initWidget(widget):
- global do_nothing_txt
- global do_something_txt
+ 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)
+ # 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.redrawWidget(widget)
- karamba.setWantRightButton(widget, 1)
+ karamba.setWantRightButton(widget, 1)
def widgetUpdated(widget):
- karamba.redrawWidget(widget)
+ karamba.redrawWidget(widget)
def widgetClicked(widget, x, y, button):
- global do_nothing_txt
+ 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
+ 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)
-
+ karamba.managementPopup(widget)
+
# This will be printed when the widget loads.
-print "Loaded my python extension!"
+print("Loaded my python extension!")