def check_click4(self, w, controller):
"""
This function let user choose what they want to overview from 'Restaurant', 'hotel', 'museum', 'attraction',
and plot their heatmap in a html file, and open it automaticlly.
Parameters:
w: tk.Listbox()
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()) == 'Restaurant':
controller.show_frame(Overview_restaurant, lat, logi)
elif w.get(w.curselection()) == 'Hotel':
controller.show_frame(Overview_hotel, lat, logi)
elif w.get(w.curselection()) == 'Attraction':
controller.show_frame(Overview_attractions, lat, logi)
elif w.get(w.curselection()) == 'Museum':
controller.show_frame(Overview_museums, lat, logi)
except IndexError:
messagebox.showwarning("Error", "Please select one of the items in the listbox")
评论列表
文章目录