def validate(self):
"""
Called when the user chooses "OK", before closing the box.
Also checks that child name is unique.
"""
for tk_list in self.frame_dict.values():
if not all(x.validate() for x in tk_list):
return False
if self.element.parent is not None:
if self.element not in self.element.parent.children:
if self.name_entry.value.get() in self.element.parent.child_names():
tkMessageBox.showwarning("", "Sibling names must be unique.")
return False
return True
评论列表
文章目录