gpt4 book ai didi

python - 如何为 Tkinter 的 python 中的按钮添加边框?

转载 作者:行者123 更新时间:2023-12-02 21:03:00 34 4
gpt4 key购买 nike

b1 = Button(tk, text=" ", font=("Consolas 30 bold"), height = 1, width = 4,bg = "white", command=lambda:checker(b1))

我要添加哪段代码来为按钮添加边框,例如使其变厚?

最佳答案

根据http://effbot.org/tkinterbook/button.htm :

borderwidth= variable

The width of the button border. The default is platform specific, but is usually 1 or 2 pixels. (borderWidth/BorderWidth)

不要与以下内容混淆:

highlightthickness= variable

The width of the highlight border. The default is system specific (usually one or two pixels). (highlightThickness/HighlightThickness)

关于python - 如何为 Tkinter 的 python 中的按钮添加边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37368517/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com