I'm trying to create a loop of buttons in Tk while each of the buttons have image embedded to it, when I first tried the loop without images it worked but now when I add images it doesn't
def menu_window(self, box):
"""Specific function for opening the menu window"""
window = Toplevel()
self.activate_window(window, 420, 380) # window default activation at size 400x400
menu = self.waiter.full_menu()
SoupMaker(self.main_url+FOOD_IMAGES).get_images() # Download menu images.
counter, rowc = 0, 0
for item in menu: # Create a button for every item in the website menu - on click, insert item to order list.
food_img = ImageTk.PhotoImage(Image.open(item+'.png'))
bt = Button(window, image=food_img) # on click
if counter >= 3 and counter % 3 == 0:
counter = 0
rowc += 1
bt.configure(command=lambda i=item + ' ' + menu[item]: box.insert(END, i))
bt.grid(sticky='W', row=counter, column=rowc) # increase row number for every button
counter += 1
print 'done buttons'
window.mainloop()
While the buttons do show in the window, they are empty and not usable(Configured commands don't work)... This is an image of the screen with the empty images: