def buttonbox(self):
box = ttk.Frame(self)
ok = ttk.Button(box, text="OK", width=10, command=self.ok, default="active")
ok.pack(side="left", padx=5, pady=5)
cancel = ttk.Button(box, text="Cancel", width=10, command=self.cancel)
cancel.pack(side="left", padx=5, pady=5)
self.bind("<Return>", self.ok)
self.bind("<Escape>", self.cancel)
box.pack()
评论列表
文章目录