我想建立一个这样的用户界面:
代码是:
for ii in range(len(solutions)):
tk.Label(text=solutions[ii], bg="lightsalmon", fg="black", font=("times", 10), relief=tk.RIDGE, width=50, anchor="w").grid(row=ii+1,column=3, ipadx=0, ipady=0, rowspan=1, sticky=tk.N+tk.E+tk.S+tk.W)
v = StringVar()
checkbutton1 = Checkbutton(mywindow, text='YES', onvalue='YES', variable=v, bg="red", fg="black", font=("times", 10), width=3, anchor="w", command=close_yes)
checkbutton1.deselect()
checkbutton1.grid(row=ii+1, column=4, ipadx=0, ipady=0, rowspan=1, sticky=tk.N+tk.E+tk.S+tk.W)
checkbutton2 = Checkbutton(mywindow, text='NO', onvalue='NO', variable=v, bg="red", fg="black", font=("times", 10), width=3, anchor="w", command=close_no)
checkbutton2.deselect()
checkbutton2.grid(row=ii+1, column=5, ipadx=0, ipady=0, rowspan=1, sticky=tk.N+tk.E+tk.S+tk.W)
问题是我只能得到最后一个检查按钮的值,你能帮我解决这个问题吗?非常感谢!