def _save_colors(self, widget): alert = ConfirmationAlert() alert.props.title = _("Saving colors") alert.props.msg = _("Do you want to save these colors?") alert.connect('response', self._alert_response_cb) self.add_alert(alert) alert.show_all()
def confirmation_alert(self, title, msg, cb, *cb_args): """Raise standard confirmation alert""" alert = ConfirmationAlert(title=title, msg=msg) def response(alert, response_id, self, cb, *cb_args): self.remove_alert(alert) if response_id is Gtk.ResponseType.OK: cb(*cb_args) alert.connect('response', response, self, cb, *cb_args) alert.show_all() self.add_alert(alert)