def cb_indicator(n, msg): global Indicates item = Indicates[n] if msg.data: timeout.set(functools.partial(cb_turnon, n), 0) else: if "sto" in item: timeout.clear(item["sto"]) timeout.set(functools.partial(cb_turnoff, n), 0)
def cb_turnon(n): global Indicates item = Indicates[n] item["tag"]["foreground"] = litcolor item["tag"]["font"] = boldfont if "sto" in item: timeout.clear(item["sto"]) item["sto"] = timeout.set(functools.partial(cb_turnoff, n), item["timeout"])
def cb_button_enable(n, enable): if enable: item["button"]['state'] = tk.NORMAL item["button"]["background"] = litcolor if "sto" in item: timeout.clear(item["sto"]) item["sto"] = timeout.set( functools.partial(cb_button_enable, n, False), item["timeout"]) else: item["button"]['state'] = tk.DISABLED item["button"]["background"] = maskcolor if "sto" in item: item.pop("sto")
def cb_edit_stat(msg): global statcheck flg = not msg.data if statcheck: timeout.clear(statcheck) statcheck = 0 if msg.data: if "stat_timeout" in Config: statcheck = timeout.set(cb_button_normal, Config["stat_timeout"]) if check_button_chenge(flg): timeout.set(functools.partial(cb_button_enable, flg), 0)