My code:
import tkinter as tk from tkinter import ttk win = tk.Tk() home_frame = tk.Frame(win) home_frame.grid(column = 0, row = 0) home_frame.config(bg = 'blue', relief = 'raised') logo = tk.Label(home_frame) logo.grid(column = 0, row = 0) logo.config(text = 'Widget', font = ('Helvetica', 30), fg = 'red') win.config(bg ='white') win.mainloop() Note that:
home_frame.config(bg = 'blue', relief = 'raised') From this, I would expect that the background of the frame turns blue, yet it doesn't. It remains grey.
Output:
As far as I'm concerned, tk.Frame() does have bg as an option.

没有评论:
发表评论