I have a function that draws a circle based on the screensize of the window. Currently, if I make the window smaller, the entire circle isn't visible. Is there any way to find out if the window has been resized so I can redraw the circle to fit in the window?
Here's my code to draw the circle:
def draw_circle():
# Get circle radius
screensize = s.screensize()
if screensize[0] > screensize[1]:
smaller = 1
else:
smaller = 0
radius = screensize[smaller]
# Draw circle
t.pensize(15)
t.pu()
t.goto(0, -radius)
t.pd()
t.circle(radius)
t.pu()
I have tried to add an if statement that checks if the screensize changes in my main loop, but that didn't work either.
P.S. I tried searching Google and StackOverflow and found no answers.