Tkinter Buttons

You can create buttons such as a quit button

quit_button = Button(root, text = "Quit", command = root.quit, anchor = 'w', width = 10, activebackground = "#33B5E5")
quit_button_window = canvas.create_window(10, 10, anchor='nw', window=quit_button)

You can make images into buttons although this does not provide an entirely satisfactory solution so I would opt for images telling the player which button to press.

playImage = PhotoImage(file="./images/play.gif")
playButton = Button(root, command = startGame, width=108, height=35, image=playImage)
playButtonWindow = canvas.create_window(canvas_width/2,canvas_height/2, window=playButton)
 
 
 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.