def _edit_point_internal(self, model, iter): x, y = model.get(iter, 0, 1) dialog = PointDialog(self.main_window, x, y) response = dialog.run() if response == gtk.RESPONSE_ACCEPT: x, y = dialog.get_point() model.set(iter, 0, x, 1, y) self.refresh() dialog.destroy()
def add_point(self, action): tab = self._get_current_dataset_tab() assert tab is not None treeview = tab.get_children()[0] model = treeview.get_model() dialog = PointDialog(self.main_window, len(model) * 1.0, 0.0) response = dialog.run() if response == gtk.RESPONSE_ACCEPT: x, y = dialog.get_point() model.append((x, y)) self.refresh() dialog.destroy()