我正在根据目录中文件的数量在根窗口中填充很多检查按钮。
Tkinter文档说:“可以将滚动条添加到列表框,画布和文本小部件中”
def displayTestFiles(picks):
#rowIndex1 = 3
#rowIndex1List = []
global rowIndex1
var1Index = 0
for pick in picks:
tempStore = IntVar()
var1.append(tempStore)
chk = Checkbutton(root, text=pick, bg = "green", fg = "black", font = ("Arial", 15), variable = var1[var1Index], command = displayTestFunctions).grid(row = rowIndex1, padx = 350, pady = 2, sticky= W)
#rowIndex1List.append(rowIndex1)
rowIndex1 += 2
var1Index += 1
我需要将垂直滚动条直接添加到根窗口,而不是特定的小部件。有可能吗?