(feat): Added simple exit button

This commit is contained in:
Blake Ridgway 2025-03-20 19:46:32 -05:00
parent cc53fe9c41
commit 49528323af

View file

@ -58,6 +58,11 @@ class TimeLogix(tk.Tk):
self.log_text = tk.Text(self, height=10, state=tk.DISABLED)
self.log_text.pack(pady=5, padx=10, fill='both', expand=True)
self.exit_button = tk.Button(
self, text="Exit", width=10, command=self.exit_app
)
self.exit_button.pack(pady=5)
def log_message(self, message):
if hasattr(self, 'log_text'):
self.log_text.configure(state=tk.NORMAL)
@ -226,6 +231,9 @@ class TimeLogix(tk.Tk):
self.total_hours = total_duration.total_seconds() / 3600
self.total_hours_label.config(text=f"Total Hours Worked: {self.total_hours:.2f}")
def exit_app(self):
self.destroy()
if __name__ == "__main__":
app = TimeLogix()
app.mainloop()