Python Forum
Can't change the colour of Tk button text
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't change the colour of Tk button text
#4
I tried it, and indeed it does work.
if you need it in a file to try, create a file named trycolor.py
and place this code in the file:

trycolor.py:
import tkinter

root = tkinter.Tk()
xx = tkinter.Button(root, text='Hello', bg="white", fg="blue")
xx.pack()
root.mainloop()
Then run it (from command line) using:
python trycolor.py
Reply


Messages In This Thread
RE: Can't change the colour of Tk button text - by Larz60+ - Feb-27-2019, 08:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Button to +1 in text box everytime it's clicked martyloo 2 246 May-02-2024, 10:30 AM
Last Post: lillydalson
  [PyQt] [Solved]Change text color of one line in TextBrowser Extra 2 4,995 Aug-23-2022, 09:11 PM
Last Post: Extra
  [WxPython] [SOLVED] How to change button label? Winfried 3 2,140 May-31-2022, 06:37 PM
Last Post: Winfried
  Can't get tkinter button to change color based on changes in data dford 4 3,488 Feb-13-2022, 01:57 PM
Last Post: dford
  tkinter change the text of the checkbox zazas321 1 3,903 Sep-17-2021, 06:19 AM
Last Post: zazas321
  [Tkinter] Make my button text update? Skata100 1 2,072 Aug-07-2021, 05:37 AM
Last Post: deanhystad
  Updating button text based upon different variable values knoxvilles_joker 0 2,265 Apr-18-2021, 04:13 AM
Last Post: knoxvilles_joker
  How to dynamically change radiobutton text kenwatts275 2 3,408 Mar-05-2021, 02:25 AM
Last Post: deanhystad
  Making a colour field Leo_Red 11 5,040 Jan-22-2021, 04:15 PM
Last Post: BashBedlam
  tkinter | Button color text on Click Maryan 2 3,432 Oct-09-2020, 08:56 PM
Last Post: Maryan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020