Hello,
I am working on a Tk program that generates geometric patterns, and I have written into all of my defs that if the variable "outline" is True it will draw a black outline, otherwise it will draw an outline the same as the fill.
I tried a function called toggle:
outline = True # when the program starts
def toggle(dummy): #dummy is just to get the event from the bind, it isn't used.
if outline == True:
outline = False
if outline == False:
outline = True
with a bind at the end:
root.bind("k", toggle)
this doesn't work because according to the function, the variable "outline" hasn't been declared because the function can't access it or something.
How can I make it so that the function can change the value of outline? I don't have any classes in my program.
Thanks in advance,
Joe