def chosen(self, label, items, choice, name):
#for child in self.mainframe.winfo_children():
# child.destroy()
self.add_emoji()
self.add_trace()
self.set_title(label)
ind = 0
for item in items:
col = ind%4 + 1
row = ind/4 + 1
if name=="true":
if item==choice:
ttk.Button(self.mainframe, text=item).grid(column=col, row=row, sticky=N+S+E+W)
else:
ttk.Button(self.mainframe, text="").grid(column=col, row=row, sticky=N+S+E+W)
else:
if item==choice:
ttk.Button(self.mainframe, text=item, image=images[item], compound="top").grid(column=col, row=row, sticky=N+S+E+W)
else:
ttk.Button(self.mainframe, text="", image=gray, compound="top").grid(column=col, row=row, sticky=N+S+E+W)
ind+=1
评论列表
文章目录