'Problem with background labels Python Tkinter
I'm making a basic window with three labels. The problem is that those labels have white background, and I don't want that. I want that labels become without any background, but I haven't got any idea. If somebody knows how to fix it, please let me know.
PD: I used canvas, but there were a lot of problems with that, however I think that make a canvas is the solution, but I don't know how to do it
Code:
from tkinter import *
import winsound
from winsound import *
from tkinter import messagebox
import time
#creamos la ventana
raiz=Tk()
raiz.title("Title")
raiz.geometry("900x550")
raiz.resizable(0,0)
raiz.iconbitmap("C:\\Users\\user\\Desktop\\Game\\descarga.ico")
#winsound.PlaySound('C:\\Users\\user\\Downloads\\pygame\\mu\\sound.wav', winsound.SND_ALIAS | winsound.SND_ASYNC)
#----------------------aa
def ventanas(frame):
frame.tkrise()
def jugar():
messagebox.showinfo("Próximamente...")
def quitar():
if messagebox.askokcancel("Saliendo...", "¿Estas seguro de que quieres salir?"):
raiz.destroy()
def clickDerecho(event):
jugar()
def clickDerecho2(event):
quitar()
#frames--------------------------------------------------------------------
frameJugar = Frame()
fondo = PhotoImage(file= r'C:\Users\user\Desktop\game\background.png')
background_label = Label(raiz, image=fondo)
background_label.place(x=0, y=0, relwidth=1, relheight=1)
texto = Label(raiz, text="JUGAR" ,bd=0, font=("COMIC SANS MS", 30, "italic"), fg="#00deff", cursor="hand2")
texto.bind("<Button-1>", clickDerecho)
texto.place(x=100, y=196)
texto2 = Label(raiz, text="TUTORIAL" ,bd=0, font=("COMIC SANS MS", 30, "italic"), fg="#00deff", cursor="hand2")
texto2.bind("<Button-1>", clickDerecho)
texto2.place(x=100, y=306)
texto3 = Label(raiz, text="SALIR" ,bd=0, font=("COMIC SANS MS", 30, "italic"), fg="#00deff", cursor="hand2")
texto3.bind("<Button-1>", clickDerecho2)
texto3.place(x=100, y=416)
#-----------------------------------------------------------------ejecutamos la ventana
raiz.protocol("WM_DELETE_WINDOW", quitar)
raiz.mainloop()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
