Skip to content Skip to sidebar Skip to footer

Attempting To Add A Simple Image Into A Label

Using a Tkinter tutorial site -as supplied by school-, I attempted to add a simple Paint-drawn gif into a Label on my Python program. mainframe = ttk.Frame(sub, padding='3 3 12 12'

Solution 1:

When you do

label = ttk.Label(mainframe).grid(column=1, row=1)

it's storing the output of Label().grid() in label, not the new Label instance created by Label().

You need to do

label = ttk.Label(mainframe)
label.grid(column=1, row=1)

if you want to both store the Label instance in label and set the grid.

Post a Comment for "Attempting To Add A Simple Image Into A Label"