Code: Select all
turtle.goto(0, 0)Code: Select all
from tkinter import *
from turtle import RawTurtle, TurtleScreen
root = Tk()
root.attributes('-fullscreen', True)
for i in range(10):
root.rowconfigure(i, weight =1, uniform = True)
for i in range(16):
root.columnconfigure(i, weight=1, uniform = True)
Canvas = Canvas(root, bg = 'white')
Canvas.grid(row = 2, column = 9, rowspan = 6, columnspan = 6, sticky = 'nesw'
Screen = TurtleScreen(Canvas)
topleft_x = (int(Canvas['width']) / -2)
topleft_y = (int(Canvas['height']) / 2)
Auch Canvas.winfo_reqwidth() + (int(Canvas['width']) gibt die korrekte X-Position für den rechten Rand an, aber -(Canvas.winfo_reqheight() - (int(Canvas['height'])))gibt nicht die korrekte Y-Position für die Unterkante an.
Mobile version