是否可以放大Checkbutton对象的小复选框?当增加文本大小时,大小不成比例。我通过以下链接(Checkbutton)搜索,找不到关于框实际大小的任何信息。谢谢你的帮助。
无法更改复选框的大小,但可以提供自己的图像。因此,一种解决方案是创建自己的不同尺寸的图像。
虽然晚了3年,但现在是可以实现的。首先,您需要找出复选框的类型。我们可以通过以下方式来完成:
# making checkbutton
option_var = tk.StringVar()
checkbutton = ttk.Checkbutton(text='abc', variable = option_var, onvalue'hi', offvalue='bye')
checkbutton.pack()
# checking checkbutton style
print(checkbutton.winfo.class())
style = ttk.Style(root)
style.configure('TCheckbutton', font = 11)
checkbox = Checkbutton(frame, width=50, height=50)
- JJAACCEeEKK