How to disable buttons in GTK3

felknight picture felknight · Jan 21, 2015 · Viewed 10.2k times · Source

Windows API has a function called EnableWindow that disables controls so user can't interact with them any more.

Is there an equivalent for GTK3 or GTK3++?

Answer

Jussi Kukkonen picture Jussi Kukkonen · Jan 21, 2015
gtk_widget_set_sensitive (widget, FALSE);

Note that if you need to check whether a widget is sensitive, gtk_widget_get_sensitive() returns the value set with the above function and gtk_widget_is_sensitive() will tell you whether the widget really is sensitive -- this is affected by parent widgets sensitivity as well.