[gtk+] widget factory: Add an example for an insensitive model button



commit d5d28a50622ff0a630369c78d4844c315c83abbb
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 16 14:05:48 2015 -0400

    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 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 14c5f04..979b7f7 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]