0
我有一個關於Tkinter按鈕的問題: 我嘗試設置三個不同的按鈕,使用不同的字體大小,但所有按鈕的創建都具有相同的字體大小 - 最後一個按鈕的大小我放置。Tkinter多個按鈕 - 不同的字體大小
我該如何解決這個問題?多個按鈕,不同的字體大小? 顯然,所有的按鈕不僅具有相同的字體大小,而且同一字體家族...
tk = Tk()
tk.wm_title("Knowledge")
frame = Frame(width=768, height=576, bg="", colormap="new")
frame.pack_propagate(0)
frame.pack()
b = Button(frame, text = "Text", compound="left", command=callback, highlightthickness=0, font = Font(family='Helvetica', size=20, weight='bold'), bd=0, bg ="white")
b.pack()
b.place(x=100, y=100)
a = Button(frame, text = "my", compound="left", command=callback, highlightthickness=0, font = Font(family='arial', size=24, weight='bold'), bd=0, bg ="white")
a.pack()
a.place(x=100, y=140)
c = Button(frame, text = "Know", compound="left", command=callback, highlightthickness=0, font = Font(family='Helvetica', size=18, weight='bold'), bd=0, bg ="white")
c.pack()
c.place(x=100, y=180)
tk.mainloop()