正在解决“TclError:Layout TLabelFrame not found”
以下为代码
from tkinter import *
from tkinter.ttk import *
a=Tk()
a.geometry("100x100")
s=Style()
s.configure("TLabelFrame",background="blue")
frame=Label(a, text="主菜单", style="TLabelFrame", width=100)
frame.pack()
a.mainloop()
错误为:_tkinter.TclError: Layout TLabelFrame not found
不明白那里错了,求解答
参考改网址:http://www.manongjc.com/detail/31-ebcxzywuwzmvrdm.html?%
configure中“style”应该是已存在的风格样式,而tkinter中不存在TLabelFrame,可以考虑使用TLabel,即s.configure("TLabel",background="blue")
后续style=“TLabel”,题主可以尝试尝试一下;