From d5d28a50622ff0a630369c78d4844c315c83abbb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 16 Mar 2015 14:05:48 -0400 Subject: [PATCH] widget factory: Add an example for an insensitive model button This will make it easier to make insensitive model buttons appear properly in other themes. --- demos/widget-factory/widget-factory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 14c5f04660..979b7f78e5 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -1336,6 +1336,7 @@ int main (int argc, char *argv[]) { GtkApplication *app; + GAction *action; static GActionEntry app_entries[] = { { "about", activate_about, NULL, NULL, NULL }, { "quit", activate_quit, NULL, NULL, NULL }, @@ -1353,6 +1354,8 @@ main (int argc, char *argv[]) g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app); + action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine"); + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);