Sep-27-2022, 08:59 PM
(This post was last modified: Sep-27-2022, 09:11 PM by Yoriz.
Edit Reason: Added code tags
)
I have created a tabbed widget with 2 tabs and I put a frame in each tab. I want to place 2 images, one in each frame, but the image is not being displayed. I can get text into each frame but not an image. There are no errors being flagged and the tabbed widget is being displayed properly. What am I missing here?
Here is the code:
Here is the code:
def tabbedPics():
Notebook = ttk.Notebook(root, width = 317, height = 230)
dinoFrame = ttk.Frame(Notebook)
Notebook.add(dinoFrame, text = "Dinosaur")
sizeFrame = ttk.Frame(Notebook)
Notebook.add(sizeFrame, text = "Size Comparison")
Notebook.place(x=900, y=220)
dinoImg = ImageTk.PhotoImage(Image.open("dino_images/Anomalocaris.gif"))
dinoLabel = Label(dinoFrame, image = dinoImg)
dinoLabel.place(x=0, y=0)
sizeImg = ImageTk.PhotoImage(Image.open("dinosize/Anomalocaris_size.gif"))
sizeLabel = Label(sizeFrame, image = sizeImg)
sizeLabel.place(x=0, y=0)
