def check_click1(self, controller, w):
"""
This function pass the user choosed time as parameters to method combined_function1 and call the combined_function1 method.
Parameters:
w: tk.Listbox()
controller
Execptions:
catch IndexError exceptions to let user choose some stuff in the listbox
"""
try:
if (not w.curselection()):
raise IndexError
if w.get(w.curselection()) == 'Tight':
self.combined_function1(1, controller)
elif w.get(w.curselection()) == 'Moderate':
self.combined_function1(2, controller)
elif w.get(w.curselection()) == 'Adequate':
self.combined_function1(3, controller)
except IndexError:
messagebox.showwarning("Error", "Please select one of the items in the listbox")
评论列表
文章目录