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.
This commit is contained in:
Matthias Clasen 2015-03-16 14:05:48 -04:00
parent 4e930ada32
commit d5d28a5062

View File

@ -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);