Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to change button background color while clicked tkinter python

#Type "activebackground=" + your chosen background color between commas
col = Button(yourWindow, text='col', bg='gray25', activebackground='cyan')
Comment

tkinter button foreground color click

# use activebackground and activeforeground properties to change the 
# button color at the instance of being pressed.
btn = Button(frame, text="Click me", activebackground="blue",
             activeforeground="white")
# activebackground will change the background of the button when clicked
# activeforeground will change the text color of the button when clicked
Comment

PREVIOUS NEXT
Code Example
Python :: plot histogram python 
Python :: strip comma from string python 
Python :: python json open file 
Python :: Flatten List in Python Using List Comprehension 
Python :: remove empty lines from file python 
Python :: change python version ubuntu 
Python :: login_required 
Python :: taking multiple input in python 
Python :: python os remove extension 
Python :: call a Python range() using range(start, stop, step) 
Python :: create empty pandas dataframe 
Python :: pandas reorder columns by name 
Python :: python remove new line 
Python :: calculate nth prime number python 
Python :: pandas remove column 
Python :: pi in python math 
Python :: np.rand.randint 
Python :: python list comprehension if else 
Python :: add a string to each element of a list python 
Python :: natural log and log base 10 in python 
Python :: how to enable execution time in jupyter lab 
Python :: Concatenate strings from several rows using Pandas groupby 
Python :: how to merge more than 2 dataframes in python 
Python :: get table selenium python pandas 
Python :: convert dict to dataframe 
Python :: reverse text python 
Python :: python reverse split only once 
Python :: measure cell execution time in ipython notebook 
Python :: dict itterator python recursive 
Python :: how to know the version of python using cmd 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =