def setup_keybox (self, ing): self.keyBox.set_model(self.rc.rg.inginfo.key_model.filter_new()) self.keyBox.set_text_column(0) curkey = self.keyBox.entry.get_text() keys = self.rc.rg.rd.key_search(ing.item) mod=self.keyBox.get_model() if keys: def vis (m, iter): x = m.get_value(iter,0) if x and x in keys: return True mod.set_visible_func(vis) else: mod=set_visible_func(lambda *args: True) mod.refilter() if len(self.keyBox.get_model()) > 6: self.keyBox.set_wrap_width(2) if len(self.keyBox.get_model()) > 10: self.keyBox.set_wrap_width(3) cb.setup_completion(self.keyBox)