diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-11-14 14:38:53 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-11-14 14:38:53 (GMT) |
commit | 260a1fe57e04891e5a5a0d64f69000a9c256bb06 (patch) | |
tree | 8c3b2a4a68b22fb99e18285e3f451742a98d34c7 | |
parent | ad927e5ada0d6cd2b4b369541cefff85e501a987 (diff) |
add plugin support for clear
-rw-r--r-- | TurtleArt/talogo.py | 1 | ||||
-rw-r--r-- | TurtleArt/tawindow.py | 6 | ||||
-rw-r--r-- | plugins/plugin.py | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 25ffceb..f3bb956 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -489,6 +489,7 @@ class LogoCode: def prim_clear(self): """ Clear screen """ + self.tw.clear_plugins() if self.tw.gst_available: from tagplay import stop_media # stop_media(self) # TODO: gplay variable diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 58b939d..338675a 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -328,6 +328,12 @@ class TurtleArtWindow(): for plugin in self._plugins: plugin.stop() + def clear_plugins(self): + """ Clear is called from the clean block and erase button """ + for plugin in self._plugins: + if hasattr(plugin, 'clear'): + plugin.clear() + def background_plugins(self): """ Background is called when we are pushed to the background. """ for plugin in self._plugins: diff --git a/plugins/plugin.py b/plugins/plugin.py index 3065129..e06cf31 100644 --- a/plugins/plugin.py +++ b/plugins/plugin.py @@ -35,6 +35,10 @@ class Plugin(gobject.GObject): """ stop is called when stop button is pressed. """ pass + def clear(self): + """ clear is called when erase button is pressed and from the clean block. """ + pass + def goto_background(self): """ goto_background is called when the activity is sent to the background. """ |