@@ -464,20 +464,18 @@ class TurtleScreenBase(object):
464464 a corresponding TurtleScreenBase class has to be implemented.
465465 """
466466
467- @staticmethod
468- def _blankimage ():
467+ def _blankimage (self ):
469468 """return a blank image object
470469 """
471- img = TK .PhotoImage (width = 1 , height = 1 )
470+ img = TK .PhotoImage (width = 1 , height = 1 , master = self . cv )
472471 img .blank ()
473472 return img
474473
475- @staticmethod
476- def _image (filename ):
474+ def _image (self , filename ):
477475 """return an image object containing the
478476 imagedata from a gif-file named filename.
479477 """
480- return TK .PhotoImage (file = filename )
478+ return TK .PhotoImage (file = filename , master = self . cv )
481479
482480 def __init__ (self , cv ):
483481 self .cv = cv
@@ -811,7 +809,7 @@ def mainloop(self):
811809 >>> screen.mainloop()
812810
813811 """
814- TK .mainloop ()
812+ self . cv . tk .mainloop ()
815813
816814 def textinput (self , title , prompt ):
817815 """Pop up a dialog window for input of a string.
@@ -966,6 +964,8 @@ class TurtleScreen(TurtleScreenBase):
966964
967965 def __init__ (self , cv , mode = _CFG ["mode" ],
968966 colormode = _CFG ["colormode" ], delay = _CFG ["delay" ]):
967+ TurtleScreenBase .__init__ (self , cv )
968+
969969 self ._shapes = {
970970 "arrow" : Shape ("polygon" , ((- 10 ,0 ), (10 ,0 ), (0 ,10 ))),
971971 "turtle" : Shape ("polygon" , ((0 ,16 ), (- 2 ,14 ), (- 1 ,10 ), (- 4 ,7 ),
@@ -989,7 +989,6 @@ def __init__(self, cv, mode=_CFG["mode"],
989989
990990 self ._bgpics = {"nopic" : "" }
991991
992- TurtleScreenBase .__init__ (self , cv )
993992 self ._mode = mode
994993 self ._delayvalue = delay
995994 self ._colormode = _CFG ["colormode" ]
0 commit comments