diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-02-13 01:25:43 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-02-13 01:25:43 (GMT) |
commit | 189494c47acad1938b2b9c2e2cc5269c2b4d1ad8 (patch) | |
tree | 7d565ee1a9c296b323dd3dc80c23aac89d202b47 /turtleart.py | |
parent | 7148d5ae0635fcf936e5f6b565c37da048900352 (diff) |
moved turtle-specific code out of collaboration plugin
Diffstat (limited to 'turtleart.py')
-rwxr-xr-x | turtleart.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/turtleart.py b/turtleart.py index 10820d3..9aeaed7 100755 --- a/turtleart.py +++ b/turtleart.py @@ -45,7 +45,7 @@ sys.argv[1:] = [] # Execution of import gst cannot see '--help' or '-h' from gettext import gettext as _ -from TurtleArt.taconstants import OVERLAY_LAYER +from TurtleArt.taconstants import OVERLAY_LAYER, DEFAULT_TURTLE_COLORS from TurtleArt.tautils import data_to_string, data_from_string, get_save_name from TurtleArt.tawindow import TurtleArtWindow from TurtleArt.taexporthtml import save_html @@ -545,5 +545,20 @@ class TurtleMain(): """ Callback for destroy event. """ gtk.main_quit() + def nick_changed(self, nick): + pass + + def color_changed(self, colors): + """ Reskin turtle with collaboration colors """ + turtle = self.tw.turtles.get_turtle(self.tw.default_turtle_name) + try: + turtle.colors = colors.split(',') + except: + turtle.colors = DEFAULT_TURTLE_COLORS + turtle.custom_shapes = True # Force regeneration of shapes + turtle.reset_shapes() + turtle.show() + + if __name__ == "__main__": TurtleMain() |