I am populating a grid with frames which are going to hold an image. However when I try to add an image to the frames through a loop, it only adds the image to the very last frame
I had attempted to add the image in the first loop immediately after the frame was created, but that was also only adding the image to the last frame. So I tried adding the images after and met the same result...Each frame should be green but as you can see only the last one is
tileList holds a custom class: Tile, which just holds the path to an image at the moment.
i = 1
j = 0
while i < 4:
while j < 3:
frameN = ttk.Frame(root, width=200, height=200, style="tileN.TFrame")
frameN.grid(row=i, column=j, padx=1, pady=1, sticky="NEWS")
frameN.grid_propagate(False)
frameList.append(frameN)
j = j + 1
j = 0
i = i + 1
for tile in frameList:
# Adding Image to Frame
img = ImageTk.PhotoImage(Image.open(tileList[0].image))
label = ttk.Label(tile, image=img)
label.grid()