#๐Ÿ”’ tk.Label causes frame to dissapear

18 messages ยท Page 1 of 1 (latest)

unreal reef
#

Adding a label containing an image to a tk.Frame causes the frame to dissapear entirely, idk why.

Specific snippet code:

        image1 = Image.open("qr_code\\qr_code.png")
        image1.resize((250, 250))
        self.test =  ImageTk.PhotoImage(image1)
        label1 = tk.Label(self.right, image=self.test, width=250, height=250)
        label1.pack(padx=0.1, pady=0.1, fill="none")

Code:
https://pastebin.com/QZ7Xaaxy

celest pollenBOT
#

@unreal reef

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

unreal reef
#

I'm resizing the image to make sure it fits within the tk.Frame

hard belfry
unreal reef
#

No difference, ill send a pic

#

With image

#

Without image

hard belfry
#

And what's "without image"?

unreal reef
unreal reef
#

Each color is a different frame

hard belfry
#

hmm dunno

#

but your original issue is solved

unreal reef
#

yeah there's that at least

#

!close

celest pollenBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.