mmkw43
Posts: 704
Joined: Tue Dec 24, 2013 6:18 pm

Tkinter front rear ?

Wed Apr 15, 2020 3:28 pm

Does anyone know how to place a label on top of another? I use place but my 2nd label is blocked out by the first (using same bg color). I want to superimpose it. (Rear -- front etc). THANK YOU.

scotty101
Posts: 4203
Joined: Fri Jun 08, 2012 6:03 pm

Re: Tkinter front rear ?

Wed Apr 15, 2020 3:54 pm

If one is infront of the other, how would you see the label underneath?

Transparency isn't supported by tkinter with labels (As far as I know)

You could achieve something similar with a canvas and two text elements drawn on top of each other.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

mmkw43
Posts: 704
Joined: Tue Dec 24, 2013 6:18 pm

Re: Tkinter front rear ?

Wed Apr 15, 2020 4:42 pm

I'm putting a smaller label with same bg color in an area on the large label that has no content.
It would look nicer to have it overlay. May not be able to do that sounds like.

scotty101
Posts: 4203
Joined: Fri Jun 08, 2012 6:03 pm

Re: Tkinter front rear ?

Wed Apr 15, 2020 8:03 pm

Sounds like you want to use a Frame rather than a second label.

If you create a frame, you can then create a label inside that frame.
The frame can have a different background colour and you can choose how much padding there should be between the edge of the frame and the label.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

mmkw43
Posts: 704
Joined: Tue Dec 24, 2013 6:18 pm

Re: Tkinter front rear ?

Thu Apr 16, 2020 1:06 pm

Yeah that's the way to go. Just my quest for less is better. Thanks.

Return to “Graphics programming”