diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index f300b4751c..f567bbf751 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -119,6 +119,24 @@ KeyEditor::add_tab (string const & name, Bindings& bindings) notebook.append_page (*t, name); } + +void +KeyEditor::remove_tab (string const &name) +{ + guint npages = notebook.get_n_pages (); + + for (guint n = 0; n < npages; ++n) { + Widget* w = notebook.get_nth_page (n); + Tab* tab = dynamic_cast (w); + if (tab) { + if (tab->name == name) { + notebook.remove_page (*w); + return; + } + } + } +} + void KeyEditor::unbind () { diff --git a/gtk2_ardour/keyeditor.h b/gtk2_ardour/keyeditor.h index 1c90269875..d9b8ed9768 100644 --- a/gtk2_ardour/keyeditor.h +++ b/gtk2_ardour/keyeditor.h @@ -41,6 +41,7 @@ class KeyEditor : public ArdourWindow KeyEditor (); void add_tab (std::string const &name, Gtkmm2ext::Bindings&); + void remove_tab (std::string const &name); private: class Tab : public Gtk::VBox