MCPcopy Index your code
hub / github.com/python/cpython / makeGraphFrame

Method makeGraphFrame

Lib/turtledemo/__main__.py:238–256  ·  view source on GitHub ↗
(self, root)

Source from the content-addressed store, hash-verified

236 return text_frame
237
238 def makeGraphFrame(self, root):
239 # t._Screen is a singleton class instantiated or retrieved
240 # by calling Screen. Since tdemo canvas needs a different
241 # configuration, we manually set class attributes before
242 # calling Screen and manually call superclass init after.
243 turtle._Screen._root = root
244
245 self.canvwidth = 1000
246 self.canvheight = 800
247 turtle._Screen._canvas = self.canvas = canvas = turtle.ScrolledCanvas(
248 root, 800, 600, self.canvwidth, self.canvheight)
249 canvas.adjustScrolls()
250 canvas._rootwindow.bind('<Configure>', self.onResize)
251 canvas._canvas['borderwidth'] = 0
252
253 self.screen = screen = turtle.Screen()
254 turtle.TurtleScreen.__init__(screen, canvas)
255 turtle.RawTurtle.screens = [screen]
256 return canvas
257
258 def set_txtsize(self, size):
259 txtfont[1] = size

Callers 1

__init__Method · 0.95

Calls 3

adjustScrollsMethod · 0.95
bindMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected