Reputation: 2775
I want that the button is disabled under some conditions with set_sensitive(False)
.
The problem is that I don't know how I could call the ok or cancel button at the MessageDialog
.
dialog_window = Gtk.MessageDialog(parent=None,
flags=Gtk.DialogFlags.MODAL,
type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.OK_CANCEL,
message_format="Edit username.")
I want something like ok_button.set_sensitive(False)
.
Upvotes: 0
Views: 249
Reputation: 14587
Something like
dialog.set_response_sensitive(Gtk.ResponseType.OK, False);
should set the sensitivity on all buttons with ResponseType OK.
Upvotes: 1