小编use*_*817的帖子

无法更改 Tkinter 中按钮的颜色

我无法使用 fg 和 bg 更改按钮的颜色。我收到此错误:_tkinter.TclError: unknown option "-fg"

_scrape_btn = ttk.Button(_mainframe, text='Scrape!', command=save, fg='blue')
_scrape_btn.grid(row=2, column=0, sticky=(N,E), pady=2)

_compress_btn = ttk.Button(_mainframe, text='Compress!', command=compress)
_compress_btn.grid(row=2, column=1, sticky=W, pady=2)
Run Code Online (Sandbox Code Playgroud)

python tkinter

0
推荐指数
1
解决办法
1446
查看次数

标签 统计

python ×1

tkinter ×1