How to Set Tkinter Background Color

How to Set Tkinter Background Color

Tkinter widget class method configure and attribute bg or background could be used to set the Tkinter widget/window background color. Method configure(background= ) try: import Tkinter as tk except: import tkinter as tk app = tk.Tk() app.title("configure method") app.geometry("300x200") app.configure(bg="red") app.mainloop() Here, app.configure(bg='red') configures the background color of app to be red. You could also use background instead of bg. app.configure(background='red') Attribute bg or background background or bg is one attribute in most of Tkinter widgets, and could be used to set the background color directly.


Tkinter Button Tkinter Geometry Tkinter Label Tkinter Font Tkinter Text Tkinter Entry

Most Popular Articles

Recently Updated Articles