def materialize_from_selected(self): if hasattr(self,'mark'): sorts = [self.lookup_node(x).sort for x in [self.mark,self.current_node]] required_sort = ivy_logic.RelationSort(sorts) rels = [r for r in self.g.relations if r.sort == required_sort] items = [str(r.rel_lit) for r in rels] msg = "Materialize this relation from selected node:" uu.listbox_dialog(self.tk,self.root,msg,items,command=functools.partial(self.materialize_from_selected_aux,rels))
def listbox_dialog(self, msg, items, command=lambda: None, on_cancel=lambda: None, multiple=False): uu.listbox_dialog(self.tk, self.frame, msg, items, command, on_cancel, multiple)