There is now code to handle this for one-item widgets (such as GtkButton) in gtk_widget_set_state_flags()