MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/turtle.py:337–360  ·  view source on GitHub ↗
(self, master, width=500, height=350,
                                          canvwidth=600, canvheight=500)

Source from the content-addressed store, hash-verified

335 using turtle graphics functions or the Turtle class.
336 """
337 def __init__(self, master, width=500, height=350,
338 canvwidth=600, canvheight=500):
339 TK.Frame.__init__(self, master, width=width, height=height)
340 self._rootwindow = self.winfo_toplevel()
341 self.width, self.height = width, height
342 self.canvwidth, self.canvheight = canvwidth, canvheight
343 self.bg = "white"
344 self._canvas = TK.Canvas(master, width=width, height=height,
345 bg=self.bg, relief=TK.SUNKEN, borderwidth=2)
346 self.hscroll = TK.Scrollbar(master, command=self._canvas.xview,
347 orient=TK.HORIZONTAL)
348 self.vscroll = TK.Scrollbar(master, command=self._canvas.yview)
349 self._canvas.configure(xscrollcommand=self.hscroll.set,
350 yscrollcommand=self.vscroll.set)
351 self.rowconfigure(0, weight=1, minsize=0)
352 self.columnconfigure(0, weight=1, minsize=0)
353 self._canvas.grid(padx=1, in_ = self, pady=1, row=0,
354 column=0, rowspan=1, columnspan=1, sticky='news')
355 self.vscroll.grid(padx=1, in_ = self, pady=1, row=0,
356 column=1, rowspan=1, columnspan=1, sticky='news')
357 self.hscroll.grid(padx=1, in_ = self, pady=1, row=1,
358 column=0, rowspan=1, columnspan=1, sticky='news')
359 self.reset()
360 self._rootwindow.bind('<Configure>', self.onResize)
361
362 def reset(self, canvwidth=None, canvheight=None, bg = None):
363 """Adjust canvas and scrollbars according to given canvas size."""

Callers

nothing calls this directly

Calls 6

resetMethod · 0.95
winfo_toplevelMethod · 0.80
__init__Method · 0.45
configureMethod · 0.45
gridMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected