@@ -464,20 +464,18 @@ class TurtleScreenBase(object):
464
464
a corresponding TurtleScreenBase class has to be implemented.
465
465
"""
466
466
467
- @staticmethod
468
- def _blankimage ():
467
+ def _blankimage (self ):
469
468
"""return a blank image object
470
469
"""
471
- img = TK .PhotoImage (width = 1 , height = 1 )
470
+ img = TK .PhotoImage (width = 1 , height = 1 , master = self . cv )
472
471
img .blank ()
473
472
return img
474
473
475
- @staticmethod
476
- def _image (filename ):
474
+ def _image (self , filename ):
477
475
"""return an image object containing the
478
476
imagedata from a gif-file named filename.
479
477
"""
480
- return TK .PhotoImage (file = filename )
478
+ return TK .PhotoImage (file = filename , master = self . cv )
481
479
482
480
def __init__ (self , cv ):
483
481
self .cv = cv
@@ -811,7 +809,7 @@ def mainloop(self):
811
809
>>> screen.mainloop()
812
810
813
811
"""
814
- TK .mainloop ()
812
+ self . cv . tk .mainloop ()
815
813
816
814
def textinput (self , title , prompt ):
817
815
"""Pop up a dialog window for input of a string.
@@ -966,6 +964,8 @@ class TurtleScreen(TurtleScreenBase):
966
964
967
965
def __init__ (self , cv , mode = _CFG ["mode" ],
968
966
colormode = _CFG ["colormode" ], delay = _CFG ["delay" ]):
967
+ TurtleScreenBase .__init__ (self , cv )
968
+
969
969
self ._shapes = {
970
970
"arrow" : Shape ("polygon" , ((- 10 ,0 ), (10 ,0 ), (0 ,10 ))),
971
971
"turtle" : Shape ("polygon" , ((0 ,16 ), (- 2 ,14 ), (- 1 ,10 ), (- 4 ,7 ),
@@ -989,7 +989,6 @@ def __init__(self, cv, mode=_CFG["mode"],
989
989
990
990
self ._bgpics = {"nopic" : "" }
991
991
992
- TurtleScreenBase .__init__ (self , cv )
993
992
self ._mode = mode
994
993
self ._delayvalue = delay
995
994
self ._colormode = _CFG ["colormode" ]
0 commit comments