0

I am creating a grid of 30x30 canvas rectangles. I am trying to bind clicks on these rectangles. I am running a loop like this:

for x in range(0, wid, 30):
    for y in range(0, leng, 30):
        rectangle = drawCanv.create_rectangle(x, y, x+30, y+30, outline='black')  
        drawCanv.tag_bind(rectangle, func=chooseImg(impFiles=importFiles, impsDirs=imports))

When I call this looop, the buttons draw, but the chooseImg function also executes on its own. Even though I did not click it. Does anyone know what is going on?

j_4321
  • 15,431
  • 3
  • 34
  • 61
MrTim
  • 1

0 Answers0