c - Is it possible to disable, fade or make a button inside a dialog unclickable in GTK? -
i have dialog this:
gtkwidget *dialog = gtk_dialog_new_with_buttons("spell checking", null, 0, gtk_stock_ok, gtk_response_accept, gtk_stock_add, gtk_response_apply, gtk_stock_cancel, gtk_response_reject, null);
after adding other necessary elements it'll this:
what want disable ok
button if list of correct words empty.
of course, there workarounds creating dialog:
- with
ok
when list not empty - without otherwise
nevertheless, i know if can disable/fade buttoon , how.
gtk widgets have property sensitive
, when it's set false, widget grayed out, i.e. user couldn't interact it. there's a function purpose
void gtk_widget_set_sensitive (gtkwidget *widget, gboolean sensitive);
also try set directly, mybutton->sensitive = false
.
Comments
Post a Comment