def quitx(h=None): """ This function facilitate Quiting of GUI Shells. :return: """ cnfrm = messagebox.askyesno(title="Quit?", message="Are you sure you want to quit?") if cnfrm > 0: if h is not None: data.set(cmd.getinfo()[1]) set_button['state'] = NORMAL h.destroy() elif h is None: a.destroy()
def refresh(): """ This function changes the status of Buttons: Start HotSpot, Stop HotSpot and Setting and also changes the content of variable 'data' which in turn changes the label that displays detail of hotspot. :return: """ x = cmd.getinfo() data.set(x[1]) status.set(x[0]) if status.get() == 0: start['state'] = NORMAL start['bg'] = "red" stop['bg'] = "yellow" set_button['state'] = NORMAL stop['state'] = DISABLED if status.get() == 1: start['state'] = DISABLED start['bg'] = "yellow" stop['bg'] = "red" set_button['state'] = DISABLED stop['state'] = NORMAL