Tkinter-如何添加其他复选框?

时间:2019-09-24 08:15:54

标签: python tkinter

我正在尝试创建一个带有其他复选框的清单。

这是我所拥有的:

var12 = IntVar()

self.Checkbox = Checkbutton(right_frame, text="Address & contact details correct", variable=var12)
self.Checkbox.grid(column = 1, row = 12, sticky = W)

输出:

enter image description here

这就是我想要做的:

enter image description here

如何添加另一个复选框?并将其链接到相同的var12

1 个答案:

答案 0 :(得分:0)

Checkbox = Checkbutton(right_frame, variable=var12)
Checkbox2 = Checkbutton(right_frame, text="Address & contact details correct", variable=var12)
Checkbox.grid(column = 1, row = 12, sticky = W)
Checkbox2.grid(column = 2, row = 12, sticky = W)

enter image description here