I've designed a GUI for a text based adventure game. I need to do some final tweaks to make sure it works smoothly.
I have several buttons (New Game, Exit Button etc.) which are represented by images. I've set the background colour of those button to #073a64 so they would match the colour of the top bar.
Image of Top Bar
However, when the button is pressed, it turn white / grey for the duration of the press. Is it possible to set / change the colour of the button whilst it is being pressed?
from tkinter import *
trialGUI = Tk()
trialGUI.geometry('710x320')
trialGUI.title("Test GUI")
trialGUI.configure(background='#073a64')
trialGUI.columnconfigure(0, weight=1)
trialGUI.rowconfigure(0, weight=1)
trialButton = Button(trialGUI, bg='#073a64', height = 10, width = 20)
trialButton.grid()
trialGUI.mainloop()
question from:
https://stackoverflow.com/questions/65902956/how-to-change-the-colour-of-a-button-whilst-it-is-being-pressed 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…