I want to create (runtime) multiple moveable label objects showing an image with Tkinter. The following code does work when the label is not showing an image, but only a background color for example. When I want to load images from a list of images, it only loads one label instead of all labels showing all the images. So no error occurs, neither does the wanted result.
images_files_list = self.get_images()
self.dynamic_labels = []
for image in images_files_list:
self.img = ImageTk.PhotoImage(Image.open(images_path + image).resize((100, 100)))
self.label = tk.Label(self, image=self.img, width=100, height=100)
self.label.place(x=0, y=0)
self.label.bind("<Button-1>", drag_start)
self.label.bind("<B1-Motion>", drag_motion)
self.dynamic_labels.append(self.label)
What am I doing wrong?