Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamutkarshtiwari/4fc7ea695a5e6e36fff102d2fe2da688 to your computer and use it in GitHub Desktop.
Save iamutkarshtiwari/4fc7ea695a5e6e36fff102d2fe2da688 to your computer and use it in GitHub Desktop.
cancel_icon = Icon(icon_name='dialog-cancel')
cancel_label = _('Continue download')
alert.add_button(Gtk.ResponseType.CANCEL, cancel_label,
cancel_icon)
stop_icon = Icon(icon_name='dialog-ok')
alert.add_button(Gtk.ResponseType.OK, _('Stop'), stop_icon)
stop_icon.show()
activity.add_alert(alert)
alert.connect('response', self.__response_cb, activity)
alert.show()
activity.present()
def __response_cb(self, alert, response_id, activity):
activity.remove_alert(alert)
if response_id is Gtk.ResponseType.CANCEL:
activity.close()
elif response_id == Gtk.ResponseType.OK:
activity.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment