From 85a44db6c60fd70d968ee79696e4d06aa359e4bf Mon Sep 17 00:00:00 2001 From: Mark Tiefenbruck Date: Fri, 30 May 2008 02:02:41 -0700 Subject: reset typeahead when adding/removing items in the menu --- src/FbTk/Menu.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 4b73b41..ec60b24 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -243,6 +243,8 @@ int Menu::remove(unsigned int index) { MenuItem *item = (*it); if (item) { + if (!m_matches.empty()) + resetTypeAhead(); menuitems.erase(it); // avoid O(n^2) algorithm with removeAll() if (index != menuitems.size()) @@ -511,6 +513,7 @@ void Menu::show() { updateMenu(); m_type_ahead.reset(); + m_matches.clear(); menu.window.showSubwindows(); menu.window.show(); -- cgit v0.11.2