I'm trying to write a program that allows me to plot some simple coordinates using the turtle module and to make it more user friendly I wanted display a cross every time the user pressed the left mouse button to plot a point. For some reason the last bit of the cross() function ie. the last line of the cross won't draw or come up until the left mouse button is pressed again. I'm really confused as to why this is happening because the code is definitely being executed. Any help would be greatly appreciated!
wn = t.Screen()
wn.title("graph")
wn.setup(width=600, height=600)
wn.tracer(0)
wn.update()
pen = t.Turtle()
pen.color("black")
pen.shape("classic")
pen.goto(0, 0)
pen.ht()
x = 10
y = 10
def cross(x, y):
print(x, y)
pen.pensize(2.5)
pen.pu()
pen.goto(x, y)
pen.pd()
pen.seth(225)
pen.color("red")
pen.fd(50)
pen.color("black")
pen.pu()
pen.goto(x, y)
pen.pd()
pen.left(180)
pen.fd(50)
pen.pu()
pen.goto(x, y)
pen.seth(315)
pen.pd()
pen.color("green")
pen.fd(50)
pen.pu()
pen.goto(x, y)
pen.left(180)
pen.pd()
pen.color("yellow")
pen.fd(50) #for some reason this is not being done
print("now")
cross(x, y)
while True:
wn.update()
wn.onscreenclick(cross)
wn.mainloop()