How to leave the label background transparent? python3 + tkinter

0
lbl2 = Label(jan, font=("Arial", 12, "bold"), text="Escolha apenas uma Categoria por vez")
lbl2.place(x=20, y=450)

I'm putting this label on a green image, but it ends up getting its gray background, is there any way I can use the tkinter to just leave the text? type a transparent background.

I've done some research here and can not find anything that fits what I'm looking for.

    
asked by anonymous 23.08.2018 / 20:22

1 answer

0

I would need more details regarding your code to help you with greater certainty of success, but you can do something similar to that.

Create a Canvas and apply the image inside it:

self.canvas = Canvas(root,width=810, height=500, bg="#000000",bd=0, highlightthickness=0, relief='ridge')
self.painel = self.canvas.create_image(403,350, image=self.image2)

Place Canvas as an Inferior Layer

self.canvas.lower(self.painel)
self.canvas.pack(side=RIGHT, padx=0, ipady=20)

Overrides Canvas with your Label or other preferred object

retangule = self.canvas.create_rectangle(40,530,220,360,outline="")

Follow a supporting link: Tkinterbook

    
04.09.2018 / 23:06