Python : Tkinter Widget Background (buttons, Entries Etc)
Solution 1:
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
Solution 2:
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.
Solution 3:
This seems to be platform dependent, and maybe theme dependent within that. I'm guessing you're on a Mac by the way the button looks in your screen shot. It seems the button text is drawn within a bitmap that provides the rounded outline of the button. It may not be within Tkinter's capability to control that.
On Windows with the classic theme, the button background is black but there is a gray outline due to the relief being raised. When I set it to relief=FLAT, it is completely black.
It would be helpful if your included sample was directly runnable. I had to add a definition for textColor, comment out command=CMD.send_mail, and add root.mainloop() at the end. I also added textColor=WHITE to the button setup.
Try playing with the relief option, or change your system's theme to see if you can affect the way the button is drawn.
Post a Comment for "Python : Tkinter Widget Background (buttons, Entries Etc)"