add ActionManager::set_sensitive() for Gtk::ActionGroup
[ardour.git] / libs / gtkmm2ext / actions.cc
index 89ee999e4c4b2914555ab749da4295ed1a63d198..edf092d909a0b4a4b800f1ff2bcf6abc05a58968 100644 (file)
@@ -93,6 +93,21 @@ ActionManager::save_action_states ()
        }
 }
 
+void
+ActionManager::set_sensitive (Glib::RefPtr<ActionGroup> group, bool yn)
+{
+       /* the C++ API for functions used here appears to be broken in
+          gtkmm2.6, so we fall back to the C level.
+       */
+
+       GtkActionGroup* grp = group->gobj();
+
+       for (GList* acts = gtk_action_group_list_actions (grp); acts; acts = g_list_next (acts)) {
+               GtkAction* action = (GtkAction*) acts->data;
+               gtk_action_set_sensitive (action, yn);
+       }
+}
+
 void
 ActionManager::enable_active_actions ()
 {