I wanted to make my app look more beautiful and it's harder than I though! Now I had an app with mainly 2 buttons and date-time label on top. Buttons are just with text, but I want to use pictures on them. That's my code now:
def showMainMenu():
global cardNumber, allowToGPIO
cardNumber = "" #Reset cardNumber global value
allowToGPIO = True
clear()
showNewTime()
watchDog.awake()
GuestTestButton = Button(canvas, text="GUEST TEST", width=buttonwidth, height=buttonheight, compound = TKinter.CENTER, command = guestTest)
GuestTestButton.config(font=("Mojave-Regular.ttf", 24))
#GuestTestButton.pack()
GuestTestButton.place(x=90, y=100)
AddEmployeeButton = Button(canvas, text="ADD NEW USER", width=buttonwidth, height=buttonheight, compound = TKinter.CENTER, command = addEmployee)
AddEmployeeButton.config(font=("Mojave-Regular.ttf", 24))
#AddEmployeeButton.pack()
AddEmployeeButton.place(x=90, y=270)
And for now, it works. But when I tried to make them more colorful (just use image instead of text), button shows up without anything on it. Is it even possible to make things like that in TKinter? Everything I do is on canvas:
app = TKinter.Tk()
canvas = TKinter.Canvas()
I tried to do this that way:
GuestImage = TKinter.PhotoImage(file="guest.gif")
GuestTestButton = Button(canvas, text="GUEST TEST", width=buttonwidth, height=buttonheight, compound = TKinter.CENTER, command = guestTest)
GuestTestButton.config(image=GuestImage, font=("Mojave-Regular.ttf", 24))
GuestTestButton.place(x=90, y=100)
But as I said, it's not working properly :D Thanks in advance for any help!