لماذا لا يظهر الحد العلوي للنافذة عند استخدام Screen من turtle؟
ممكن تصور الكود الخاص بيك؟
حايز عامل طول الشاشه كبير..
بس ابعت الكود نتأكد .
from turtle import Turtle,Screen
turtle_circle = Turtle()
turtle_triangle = Turtle()
turtle_square = Turtle()
turtle_writer = Turtle()
window = Screen()
window.setup(width = 1000, height = 1000)
def coordinations (self,x,y):
self.penup()
self.goto(x,y)
self.pendown()
def parameters (self,shape,color,pensize):
self.shape(shape)
self.color(color)
self.pensize(pensize)
def circle():
parameters(turtle_circle,“square”,“black”,1)
coordinations(turtle_circle,-300,0)
turtle_circle.circle(50)
def triangle():
parameters(turtle_triangle,“circle”,“violet”,5)
coordinations(turtle_triangle,0,100)
for _ in range(3):
turtle_triangle.forward(100)
turtle_triangle.left(120)
def square():
parameters(turtle_square,“turtle”,“red”,10)
coordinations(turtle_square,300,0)
for _ in range(4):
turtle_square.forward(100)
turtle_square.left(90)
def exit():
window.clear()
window.bgcolor(“light blue”)
coordinations(turtle_writer,0,50)
turtle_writer.write(“Press any spot to exit”,font = (“arial”,32),align = “center”)
coordinations(turtle_writer,0,-50)
turtle_writer.write(“اضغط على أي مكان للخروج”,font = (“arial”,24),align = “center”)
coordinations(turtle_writer,0,0)
while True:
shape = window.textinput(“رسم الأشكال”,“أدخل اسم الشكل الذي تريد رسمه: دائرة، مثلث، مربع.”)
if shape == “دائرة” or shape == “circle” or shape == “Circle”:
circle()
elif shape == “مثلث” or shape == “triangle” or shape == “Triangle”:
triangle()
elif shape == “مربع” or shape == “square” or shape == “Square”:
square()
elif shape == “خروج” or shape == “exit” or shape == “Exit”:
exit()
break
else:
continue
window.exitonclick()
اظن ان المشكلة بسبب ان حجم الشاشة كبير في
window.setup(width = 1000, height = 1000)