diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-15 16:42:45 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-15 16:42:45 -0400 |
commit | f83a7f4131214e74ccc06bc2dab28da3d4e49302 (patch) | |
tree | 0093410e62fe3b53214b129c91ed6a5146eb5886 /gtk2_ardour/keyeditor.cc | |
parent | 89ba1c9edd12f30a298a45bcef99b04c4b8852b1 (diff) |
extend API of key binding editor to allow for tab removal
Diffstat (limited to 'gtk2_ardour/keyeditor.cc')
-rw-r--r-- | gtk2_ardour/keyeditor.cc | 18 |
1 files changed, 18 insertions, 0 deletions
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<Tab*> (w); + if (tab) { + if (tab->name == name) { + notebook.remove_page (*w); + return; + } + } + } +} + void KeyEditor::unbind () { |