Skip to content

Commit

Permalink
-Data refresh again!
Browse files Browse the repository at this point in the history
- bug fixed.
- data refresh again
- update class menu got updated.
  • Loading branch information
pagega committed Nov 23, 2023
1 parent 4ab627e commit c4d6a75
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,21 @@ def __init__(self, master):
def update_class_menu(self):
# Update the class menu options
new_keys = DATA.classes
current_value = self.selected_class.get()

menu = self.class_menu['menu']
menu.delete(0, 'end') # Remove old options

for key in new_keys:
menu.add_command(label=key, command=lambda value=key: self.selected_class.set(value))

if new_keys:
self.selected_class.set(new_keys[0])
# Check if the current value is in the new keys, and if not, set the default value
if current_value not in new_keys:
self.selected_class.set(new_keys[0])
else:
self.selected_class.set(current_value)



def update_table_view(self, *args):
Expand Down

0 comments on commit c4d6a75

Please sign in to comment.