mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #22065: Menus, unlike Menubottons, do not have a state option.
Since a new demo can now be loaded while one is running, adjust loadfile to do the same cleanup as stopIt.
This commit is contained in:
parent
cf26115651
commit
8450c53315
2 changed files with 7 additions and 8 deletions
|
@ -260,12 +260,13 @@ class DemoWindow(object):
|
|||
return menu
|
||||
|
||||
def refreshCanvas(self):
|
||||
if not self.dirty: return
|
||||
self.screen.clear()
|
||||
self.dirty=False
|
||||
if self.dirty:
|
||||
self.screen.clear()
|
||||
self.dirty=False
|
||||
|
||||
def loadfile(self, filename):
|
||||
self.refreshCanvas()
|
||||
self.clearCanvas()
|
||||
turtle.TurtleScreen._RUNNING = False
|
||||
modname = 'turtledemo.' + filename
|
||||
__import__(modname)
|
||||
self.module = sys.modules[modname]
|
||||
|
@ -318,9 +319,7 @@ class DemoWindow(object):
|
|||
self.exitflag = False
|
||||
self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED,
|
||||
"STOPPED!", "red")
|
||||
turtle.TurtleScreen._RUNNING = False
|
||||
else:
|
||||
turtle.TurtleScreen._RUNNING = False
|
||||
turtle.TurtleScreen._RUNNING = False
|
||||
|
||||
def _destroy(self):
|
||||
self.root.destroy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue