From 35a12760d7e7e71f7534ce00b596cd6044ae44f2 Mon Sep 17 00:00:00 2001 From: Amy Bowersox Date: Wed, 11 Dec 2019 14:45:59 -0700 Subject: [PATCH] global variable definitions again --- scripts/demo1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/demo1.py b/scripts/demo1.py index 9099847..2f4037d 100755 --- a/scripts/demo1.py +++ b/scripts/demo1.py @@ -44,6 +44,7 @@ def draw_current_color(): hdc.solid_rectangle(cmd2_rect[0] + 6, cmd2_rect[1] + 6, cmd2_rect[0] + 54, cmd2_rect[1] + 54) def select_next_color(): + global current_color current_color += 1 if current_color == len(color_list): current_color = 0 @@ -99,6 +100,7 @@ def draw_current_tool(): hdc.bitblt(cmd1_rect[0] + 6, cmd1_rect[1] + 6, cmd1_rect[0] + 54, cmd1_rect[1] + 54, hdc_bits, 0, 0, 0) def select_next_tool(): + global current_tool current_tool += 1 if current_tool == len(tool_list): current_tool = 0