summaryrefslogtreecommitdiff
path: root/Demo
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-07-27 03:00:47 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2014-07-27 03:00:47 -0400
commit87355a77db6fea8d0718701a86632db7ed2e3f14 (patch)
tree59701113c6ff28469e3b71165967e5a3c3acc0cf /Demo
parent0a649c7bb1bdc6238963decc5b77ad805e551a9e (diff)
downloadcpython-git-87355a77db6fea8d0718701a86632db7ed2e3f14.tar.gz
Modernize turtledemo with conditional expressions; remove duplicate line.
Diffstat (limited to 'Demo')
-rwxr-xr-xDemo/turtle/turtleDemo.py25
1 files changed, 6 insertions, 19 deletions
diff --git a/Demo/turtle/turtleDemo.py b/Demo/turtle/turtleDemo.py
index 32677e1ea2..5ec980ea2b 100755
--- a/Demo/turtle/turtleDemo.py
+++ b/Demo/turtle/turtleDemo.py
@@ -144,25 +144,12 @@ class DemoWindow(object):
def configGUI(self, menu, start, stop, clear, txt="", color="blue"):
self.ExamplesBtn.config(state=menu)
- self.start_btn.config(state=start)
- if start==NORMAL:
- self.start_btn.config(bg="#d00")
- else:
- self.start_btn.config(bg="#fca")
-
- self.stop_btn.config(state=stop)
- if stop==NORMAL:
- self.stop_btn.config(bg="#d00")
- else:
- self.stop_btn.config(bg="#fca")
- self.clear_btn.config(state=clear)
-
- self.clear_btn.config(state=clear)
- if clear==NORMAL:
- self.clear_btn.config(bg="#d00")
- else:
- self.clear_btn.config(bg="#fca")
-
+ self.start_btn.config(state=start,
+ bg="#d00" if start == NORMAL else "#fca")
+ self.stop_btn.config(state=stop,
+ bg="#d00" if stop == NORMAL else "#fca")
+ self.clear_btn.config(state=clear,
+ bg="#d00" if clear == NORMAL else"#fca")
self.output_lbl.config(text=txt, fg=color)
def makeLoadDemoMenu(self):