cleanup/generalize

(cherry picked from commit 7e1460b501)
This commit is contained in:
Peter D. Gray 2023-09-06 09:00:22 -04:00 committed by doc-hex
parent 760ef7f168
commit fa05c28501

View File

@ -171,8 +171,9 @@ class MenuSystem:
self.count = len(self.items)
def goto_label(self, label):
# pick menu item based on label text
for i, m in enumerate(self.items):
if m.label == label or m.label[-4:] == label:
if m.label.endswith(label):
self.goto_idx(i)
return True
return False