Tkinter GUI Python background color
Question: I'm writing a Tkinter application with buttons, graphs, sliders, etc, but I
can't get their background uniform.

    
    
    import Tkinter
    from Tkinter import *
    root =Tk()
    root.title('Button')
    root.configure(bg='gray')
    
    Button(text='Button',bg='gray').pack(side=BOTTOM)
    root.mainloop()
    

If you run this code, the background of the main window is indeed gray, but
the image of the button has a white area around it. Is there any way to fix
this?


Answer: If the issue is that you don't like the default button effect on your system,
you don't have to change the border width; instead you can set `relief='flat'`
in the button declaration. That way, you'll still get the "sunken" look when
you click the button, which you won't get if you just set `borderwidth` to 0
or a value close to it. Another issue with lessening `borderwidth` is that it
may make the button smaller than expected.

