diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-21 14:20:55 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-21 14:20:55 (GMT) |
commit | 029b30bf51a1f614cba8b1ff94dcbc4bd32b41f7 (patch) | |
tree | 6b44dcd01e67096d5c9efa988ebd14a3a1410e25 | |
parent | e48a412ff5243f03ebbb75daede281bd3621714f (diff) |
put all global objects of single-instance classes into the global_objects dict
- E.g., the global TurtleArtWindow instance, the global LogoCode instance,
etc.
-rw-r--r-- | TurtleArt/tawindow.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 467a772..552b3f2 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -96,6 +96,9 @@ _PLUGIN_SUBPATH = 'plugins' _MACROS_SUBPATH = 'macros' +global_objects = {} # the global instances of single-instance classes + + class TurtleArtWindow(): ''' TurtleArt Window class abstraction ''' @@ -298,6 +301,11 @@ class TurtleArtWindow(): from tabasics import Palettes self._basic_palettes = Palettes(self) + global_objects["window"] = self + global_objects["canvas"] = self.canvas + global_objects["logo"] = self.lc + global_objects["turtles"] = self.turtles + if self.interactive_mode: gobject.idle_add(self._lazy_init) else: |