Hello there! I really need help with TkInter library. I worked on my Mac and created a small and easy game on it. When I started to design it ( like adding colors and pictures ), I noticed that my design isn’t correct! Here I will show you. I used this code:
path = '/Users/emiliustube/Desktop/Brain_Boiler/bg.png'
img = ImageTk.PhotoImage(Image.open(path))
path2 = '/Users/emiliustube/Desktop/Brain_Boiler/bone.png'
img2 = ImageTk.PhotoImage(Image.open(path2))
root['bg'] = 'black'
#playsound('/Users/emiliustube/Desktop/Brain_Boiler/music.mp3', False)
root.title('Calculator Game')
root.wm_attributes('-alpha',0.97)
root.geometry('500x500')
root.resizable(width=False, height=False)
canvas = Canvas(root, height = 500, width = 500)
canvas.pack()
frame = Frame(root)
frame.place(relwidth=1, relheight=1)
title = Label(frame, text="Calculator Game", fg='yellow', bg = "black", font = ("Arial", 50))
title.place(relx = 0.1, rely = 0.1)
canvas.create_image(30,30,image=img2)
play = Button(frame,image = img2, command = Main, text = "Play!", highlightthickness=0, bd = 0, font = ("Arial",60, "bold"))
play.place(relx = 0, rely = 0.4)
rules = Button(frame, text = "Rules", image = img2, fg = "black", command = Rules, highlightthickness=0, bd = 0, font = ("Arial",60, "bold"))
rules.place(relx = 0, rely = 0.6)
exit_button = Button(frame, text = "Exit", image = img2, fg = "black", highlightthickness=0, bd = 0, command=root.destroy, font = ("Arial",60, "bold"))
exit_button.place(relx = 0, rely = 0.8)
text2 = Label(frame, text = "Commands:", fg = "yellow", bg = "systemTransparent")
text2.place(relx = 0.7, rely = 0.86)
input = Entry(frame, bg = 'white', fg = "black", font = ("Arial", 25))
input.place(relx = 0.7, rely = 0.9)
root.attributes('-fullscreen', True)
And here is the result:
I really don’t understand why my buttons are with this white frame… I also checked the format of my image but it is still .png . You can see in my code that I also tried to set it with borders or highlightthickness but it didn’t get result. Please help me to remove this white background on the buttons to look like just bone buttons.
Waiting for your answers!