我正在嘗試構建 GUI 程式并想知道誰來更改標簽背景顏色?
import tkinter as tk
window = Tk()
timer_label = Label(text="Timer", fg=GREEN, font=(FONT_NAME, 50, "normal"))
timer_label.pack()
root.mainloop()
uj5u.com熱心網友回復:
要更改背景,您可以使用“bg”作為示例:
timer_label = Label(text="Timer", fg=GREEN, bg="red" font=(FONT_NAME, 50, "normal"))
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/518295.html
