last day (15 days later) » 

2:33 PM
0
Q: Why is image shown incorrectly in Tkinter?

Abhishta GatyaImage is shown incorrectly, I have it in my image/burger_button.png to make a burger menu(stack menu) for options. But the image is displayed like this which is not what I want. The image looks like this! Here is the code : class Musec: def __init__(self): self.mode = 'TRANSPOS...

 
@PRMoureu Done its there, its small...
@Rawing I think its a bit different, not a duplicate
 
@AbhishtaGatya And why is that?
 
@Rawing please take time to answer the question, if you think it is duplicate, please give me the solution/ guide to implement other question's solution to my code. If it works, then its a duplicate, if it doesn't its not. And please know that I'm using python3.5 not python2.7.
 
The solution is in the duplicate... It's telling you to save the PhotoImage in an instance attribute.
 
2:34 PM
If you really wanted to help me, i did what you ask to make it as an instance attribute, now its giving me a RuntimeError: Too early to create image
 
Code please?
Sounds like you're trying to create the PhotoImage before you've created a Tk() instance
 
Looks like I guessed right
 
okay so what should I do? its my first time using tkinter
 
It should work if you create the PhotoImage after the Tk
 
2:38 PM
okay let me try, wait a second
its looking better now, but might need some readjusting, thank you :) i'll tell you if it works perfect
 
you're welcome
 

last day (15 days later) »