Hello everybody,

I've a somewhat odd issue displaying a .png image onto a Tkinter canvas.
The image is surrounded by a grey frame.
Here below an excerpt of the relevant code and by the way I'm running under windows xp.
The same thing happens with the menu of the gui, it stays grey whatever colour I set.
Any suggestion about this issue?

self.frameCanvas = Frame(master, bg="white", bd=0, relief=FLAT)
self.frameCanvas.grid(column=1, row=0, rowspan=2, sticky=NE, padx=10, pady=5)
#
self.logo = Canvas(self.frameCanvas, width=70, height=70, bg="white", bd=0)
self.logo.create_image(36, 36, image=self.Logo_TCTK)
self.logo.grid()
self.logo.image = self.Logo_TCTK

Thank you all

Recommended Answers

You might have to give us some more of your code. Don't be bashful!

Jump to Post

All 6 Replies

You might have to give us some more of your code. Don't be bashful!

I can indeed give you the full code of the app infrastructure which is the one creating the gui's aspect and common widgets. This part then call the various modules which I don't include here as I don't think they're useful to solve the problem.
Be warned that the code is rude and not at all smooth and clean

Thanks to all again.

Gab

that's it!
Thank you so much!

By the way, any advice to change the default menu grey colour? Just setting the bg option doesn't work. Somewhere I read it's a Tkinter bug.
Any idea?

Gab

google is your friend !
I post the solution here, for future reference:

set highlightthickness to 0 (zero)

That works fine indeed on the canvas widget.
For the menu it's not a valid option however.
I tried and googled some time ago and found only one reference stating that the bg setting in the menu widget it's broken.
That's why I was wondering if someone of you already faced such a problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.