Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Can't change the colour of Tk button text
Please help! This code doesn't work, but doesn't produce an error.

from tkinter import *
master = Tk()
button = Button(master, text="some text", bg="red")
button.grid(column=0, row=0)

This code is a simplified version of some code I'm using in a much bigger project. I am using Python 3 on a Mac and Raspberry Pi. The colour change option doesn't seem to work on the Mac or the Pi for buttons, but does for labels, etc., .

Top Page

Messages In This Thread
Can't change the colour of Tk button text - by Pilover - Feb-26-2019, 09:26 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to make button text bold in Tkinter? scratchmyhead 2 126 May-16-2020, 02:53 AM
Last Post: scratchmyhead
  [Tkinter] Python 3 change label text gw1500se 6 697 May-08-2020, 05:47 PM
Last Post: deanhystad
  [Tkinter] Text Button - How Do I Reduce The Margin? vman44 6 229 Apr-27-2020, 10:48 PM
Last Post: Larz60+
  [PyQt] Python PyQt5 - Change label text dynamically based on user Input ppel123 1 494 Mar-20-2020, 07:21 AM
Last Post: deanhystad
  change background color of button ieee488 3 3,359 Jul-30-2019, 09:49 PM
Last Post: ieee488
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 864 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp
  Text after push button chano 13 1,169 Jul-05-2019, 03:10 PM
Last Post: Yoriz
  [Tkinter] changing the frame colour nick123 2 2,344 May-14-2019, 02:48 PM
Last Post: nick123
  How to change the text in label? ;/ Dzonzi 3 16,366 Jul-18-2018, 07:26 PM
Last Post: nilamo
  Set input text from button gio123 1 1,245 Mar-01-2018, 10:28 AM
Last Post: gio123

Forum Jump:

Users browsing this thread: 1 Guest(s)