I'm having a bit of a problem in creating my GUI's. It's when changing backgrounds, I can change the whole background, and also the background of the labels and such, but when it comes to buttons and entry fields etc, there is a white area behind the button that i cannot seem to change :S
The problem can be seen in the picture below.
(Don't have enough reputation to post picture, so will link it) http://www.thesite.dk/upload/media/tkinter.png
With the code :
from Tkinter import *
background = "BLACK"
textColor = "WHITE"
root = Tk()
root.configure(bg=background)
Email = Label(root, text="Enter E-mail Address :", font=("Lucida Grande", 12), fg=textColor, background=background)
Email.grid(row=6, column=0, sticky=NW, padx=19)
EmailField = Entry(root, width=30)
EmailField.grid(row=6, column=0, columnspan=3, sticky=NW, padx=159)
EmailButton = Button(root, text="Mail It !", background=background)
EmailButton.grid(row=6, column=0, columnspan=6, sticky=NW, padx=389)
SM_Status = StringVar()
EmailStatus = Label(root, textvariable=SM_Status, font=("Lucida Grande", 12), fg=textColor, background=background)
EmailStatus.grid(row=6, column=2, sticky=NW, padx=20)
There may be a simple solution, but countless googles and hours of reading documentation and forum posts has gotten me nowhere :( I hope youre able to help...
And yes, I'm using Mac OS X with python 2.6
I know it's been a while and you're certainly no longer working on this code, but I found a solution, and I'll post it here for everybody who has a similar issue. It's the same as the way you get the area around an entry to be your background color:
highlightbackground=color
On the macintosh there's not much you can do about the background color of native buttons. Such is the price we pay for native buttons. On other platforms and for other widgets, what you are seeing is probably the "highlight background" which can be modified with the highlightbackground
and highlightthickness
attributes of a widget. This is the area used by the widget to denote focus.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With