diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2018-12-10 18:40:00 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2018-12-10 18:40:00 -0500 |
commit | ab61c6837f6aed0179e098c83a81445fba1bab9a (patch) | |
tree | 5af8d9bdb3b8621e66e7dcb374220a4af6d4908c /libs/gtkmm2ext/actions.cc | |
parent | 12a88c9706204a7bd2a674896d0fe93654139f0f (diff) |
add ActionManager::set_sensitive() for Gtk::ActionGroup
Diffstat (limited to 'libs/gtkmm2ext/actions.cc')
-rw-r--r-- | libs/gtkmm2ext/actions.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/actions.cc b/libs/gtkmm2ext/actions.cc index 89ee999e4c..edf092d909 100644 --- a/libs/gtkmm2ext/actions.cc +++ b/libs/gtkmm2ext/actions.cc @@ -94,6 +94,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 () { if (!actions_disabled) { |