fix: Add parent window reference to dose entry error and success messages

This commit is contained in:
William Valentin
2025-07-28 21:39:53 -07:00
parent cbf01ad3dd
commit 01a341130e

View File

@@ -643,10 +643,14 @@ class UIManager:
dose = dose_entry_var.get().strip()
# Find the parent edit window
parent_window = dose_text_widget.winfo_toplevel()
if not dose:
messagebox.showerror(
"Error",
f"Please enter a dose amount for {medicine_name}",
parent=parent_window,
)
return
@@ -673,6 +677,7 @@ class UIManager:
messagebox.showinfo(
"Success",
f"{medicine_name.title()} dose recorded: {dose} at {time_str}",
parent=parent_window,
)
def _parse_dose_text(self, text: str, date: str) -> str: