From 9bf87b328f9ed0fd3fa62d7791bb0b3ecc6943c7 Mon Sep 17 00:00:00 2001 From: JP-Carr Date: Sun, 6 Sep 2020 15:03:30 +0100 Subject: [PATCH] Added tooltips Unlabled textboxes now have simple tooltips --- tracker_gui.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tracker_gui.py b/tracker_gui.py index 03f0122..0caefb9 100644 --- a/tracker_gui.py +++ b/tracker_gui.py @@ -4,24 +4,28 @@ layout=[ [sg.Text("Time")], - [sg.InputText("{}:00".format(ct.db["hour"]),size=(10,1), readonly=True,key="hour_display"), sg.InputText(ct.db["day"], size=(7,1), readonly=True,key="day_display"), sg.InputText(ct.db["tenday"], size=(10,1), readonly=True,key="tenday_display"), sg.InputText("{}. {}".format(ct.db["month"][0],ct.db["month"][1]), size=(30,1), readonly=True,key="month_display"), sg.InputText(ct.db["year"], size=(5,1), readonly=True,key="year_display")], + [sg.InputText("{}:00".format(ct.db["hour"]),size=(6,1), readonly=True,key="hour_display", tooltip="Time - 24 hour"), sg.InputText(ct.db["day"], size=(3,1), readonly=True,key="day_display", tooltip="Day of the month"), sg.InputText(ct.db["tenday"], size=(2,1), readonly=True,key="tenday_display", tooltip="Tenday"), sg.InputText("{}. {}".format(ct.db["month"][0],ct.db["month"][1]), size=(30,1), readonly=True,key="month_display", tooltip="Month"), sg.InputText(ct.db["year"], size=(5,1), readonly=True,key="year_display", tooltip="Year - DR")], [sg.Text("Temperature"), sg.InputText(ct.db["temperature"], size=(20,1), readonly=True,key="temp_display"), sg.Text("Precipitation"), sg.InputText(ct.db["precipitation"], size=(6,1), readonly=True,key="precip_display")], [sg.Text("Wind Speed"), sg.InputText(ct.db["windspeed"], size=(6,1), readonly=True,key="WS_display"), sg.Text("Wind Direction"), sg.InputText(ct.db["wind_dir"], size=(3,1), readonly=True,key="WD_display")], - [sg.InputText("0", size=(5,1), key="hour_input"), sg.InputText("0", size=(5,1), key="day_input"), sg.Button("Submit")] + [sg.InputText("0", size=(5,1), key="hour_input", enable_events=True, tooltip="Hour Change"), sg.InputText("0", size=(5,1), key="day_input", tooltip="Day Change"), sg.Button("Submit")] ] updatable=["hour_display", "day_display", "tenday_display", "month_display", "year_display"]+["temp_display", "precip_display"]+["WS_display", "WD_display"] update_values=["{}:00".format(ct.db["hour"]), ct.db["day"], ct.db["tenday"], "{}. {}".format(ct.db["month"][0],ct.db["month"][1]), ct.db["year"]]+[ct.db["temperature"], ct.db["precipitation"]]+[ct.db["windspeed"], ct.db["wind_dir"]] -window=sg.Window("D&D Time Manager", layout, finalize=True) +window=sg.Window("D&D Time Manager", layout, finalize=True, icon="dnd_logo.ico") +#sg.theme("DarkRed1") #print(len(updatable), len(update_values)) while True: event, values = window.read() if event == sg.WIN_CLOSED: break + # elif event==window["hour_input"]: + # print("asdfaf") + elif event == "Submit": try: h=int(window["hour_input"].Get()) @@ -39,9 +43,8 @@ for i in range(len(updatable)): window[updatable[i]].Update(update_values[i]) window["hour_input"].Update("0") - window["day_input"].Update("0") - - - + window["day_input"].Update("0") + else: + print (event) window.close() \ No newline at end of file