def _conf_clicked(self, toolbutton, data=None): newpath = self._pathtext.get_text() for name, path in self.paths: if path == newpath: newpath = None break from thgconfig import ConfigDialog dlg = ConfigDialog(self.root, True) dlg.show_all() if newpath: dlg.new_path(newpath) else: dlg.focus_field('paths.default') dlg.run() dlg.hide() self.paths = self._get_paths() self.pathlist.clear() for row, (name, path) in enumerate(self.paths): self.pathlist.append([path])