Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'tutorius/actions.py')
-rw-r--r--tutorius/actions.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tutorius/actions.py b/tutorius/actions.py
index 4269cd7..eb4a6b1 100644
--- a/tutorius/actions.py
+++ b/tutorius/actions.py
@@ -82,6 +82,7 @@ class DragWrapper(object):
"""Callback for end of drag (stolen focus)."""
self._dragging = False
+
def set_draggable(self, value):
"""Setter for the draggable property"""
if bool(value) ^ bool(self._drag_on):
@@ -177,6 +178,15 @@ class Action(TPropContainer):
self.position = [int(x), int(y)]
self.__edit_img.destroy()
+ # Adding methods for pickling and unpickling an object with
+ # properties
+ def __getstate__(self):
+ return self._props.copy()
+
+ def __setstate__(self, dict):
+ self._props.update(dict)
+
+
class OnceWrapper(Action):
"""
Wraps a class to perform an action once only