13
0

additional API to make it nicer to get an existing action group

This commit is contained in:
Paul Davis 2019-01-13 11:59:18 -06:00
parent b67bb8165b
commit f974ff594a
2 changed files with 13 additions and 0 deletions

View File

@ -360,6 +360,18 @@ ActionManager::create_action_group (void * owner, string const & name)
return g; return g;
} }
RefPtr<ActionGroup>
ActionManager::get_action_group (string const & name)
{
for (ActionGroups::iterator g = groups.begin(); g != groups.end(); ++g) {
if ((*g)->get_name () == name) {
return *g;
}
}
return RefPtr<ActionGroup> ();
}
RefPtr<Action> RefPtr<Action>
ActionManager::register_action (RefPtr<ActionGroup> group, const char* name, const char* label) ActionManager::register_action (RefPtr<ActionGroup> group, const char* name, const char* label)
{ {

View File

@ -71,6 +71,7 @@ namespace ActionManager {
LIBGTKMM2EXT_API extern void disable_active_actions (); LIBGTKMM2EXT_API extern void disable_active_actions ();
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ActionGroup> create_action_group (void * owner, std::string const & group_name); LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ActionGroup> create_action_group (void * owner, std::string const & group_name);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::ActionGroup> get_action_group (std::string const & group_name);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group, const char* name, const char* label); LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group, const char* name, const char* label);
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group, LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,