I'm working on an app to display a grid of images, much like the main screen of iPhoto or other similar programs. To do so, I set up a Canvas, and iterate through a list of filenames, creating a PhotoImage from each, and displaying them on the canvas:
self.canvas = Canvas(self.bottomFrame, width = 700, height = 470, bg = "Red")
self.canvas.pack()
for i, filename in enumerate(image_list):
photo_image = PhotoImage(filename)
self.canvas.create_image(100*(round(i/4)+1), 100*(i+1), image = photo_image)
self.labelList.append(photo_image)
The labelList is an attribute of the Application class, and the image_list is populated with filenames of .gif photos. When I run the app, however, no images display. I know the canvas is there, because a red rectangle shows up, but there are no images on it.
What am I missing here - I've scrolled through endless pages of discussion looking for results and haven't found any that work.
filename?self.labelList. No problem there.