cleanup/generalize

This commit is contained in:
Peter D. Gray 2023-09-06 09:00:22 -04:00
parent 3cec82d912
commit 7e1460b501
No known key found for this signature in database
GPG Key ID: A2DCD558C2BE5D7C

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