diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-02-19 17:22:20 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-02-19 17:22:20 (GMT) |
commit | c4f1fee3d593a56482ccb2530bc3da5f7894892a (patch) | |
tree | a32b5f94b0ee04d174be9dc7c515fed0603a0094 | |
parent | 90db57b3139bcedad1b567f24c0f2f6ced9d2d55 (diff) |
removed unused .ag flag and added background/foreground plugin calls
-rw-r--r-- | TurtleArt/talogo.py | 1 | ||||
-rw-r--r-- | TurtleArt/tawindow.py | 11 | ||||
-rw-r--r-- | TurtleArtActivity.py | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index a4bb04d..dddfdb0 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -457,7 +457,6 @@ class LogoCode: self.trace = 0 self.update_values = False self.gplay = None - self.ag = None self.filepath = None self.dsobject = None self._start_time = None diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 1b0e011..f12a753 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -334,6 +334,16 @@ class TurtleArtWindow(): for plugin in self._plugins: plugin.stop() + def background_plugins(self): + """ Background is called when we are pushed to the background. """ + for plugin in self._plugins: + plugin.goto_background() + + def foreground_plugins(self): + """ Foreground is called when we are return from the background. """ + for plugin in self._plugins: + plugin.return_to_foreground() + def _quit_plugins(self): """ Quit is called upon program exit. """ for plugin in self._plugins: @@ -1767,7 +1777,6 @@ class TurtleArtWindow(): """ Run a stack of blocks. """ if blk is None: return - self.lc.ag = None top = find_top_block(blk) self.lc.run_blocks(top, self.just_blocks(), True) if self.interactive_mode: diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 48773ef..c9aa9cb 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -428,10 +428,10 @@ class TurtleArtActivity(activity.Activity): def __visibility_notify_cb(self, window, event): """ Callback method for when the activity's visibility changes. """ if event.state == gtk.gdk.VISIBILITY_FULLY_OBSCURED: - self.tw.lc.ag = None + self.tw.background_plugins() elif event.state in \ [gtk.gdk.VISIBILITY_UNOBSCURED, gtk.gdk.VISIBILITY_PARTIAL]: - pass + self.tw.foreground_plugins() def update_title_cb(self, widget, event, toolbox): """ Update the title. """ |