a better way to build ArdourDropdowns from Actions

This commit is contained in:
Paul Davis 2025-06-25 22:17:53 -06:00
parent bdf9dec411
commit 02abf956d7
2 changed files with 7 additions and 0 deletions

View file

@ -195,3 +195,9 @@ ArdourDropdown::default_text_handler (std::string const& text) {
set_text (text);
StateChanged (); /* EMIT SIGNAL */
}
void
ArdourDropdown::append (Glib::RefPtr<Action> action)
{
_menu.items().push_back (Menu_Helpers::MenuElem (action->get_short_label(), sigc::mem_fun (action.get(), &Action::activate)));
}

View file

@ -45,6 +45,7 @@ public:
void clear_items ();
void AddMenuElem (Gtk::Menu_Helpers::Element e);
void append (Glib::RefPtr<Gtk::Action>);
void disable_scrolling();