jcs
/wallops
/amendments
/125
main: Use ModalDialogFilter for about screen, fix enabling Hide menu
We don't call the focusable's update_menu when the window is hidden,
which is when we need the hide menu option enabled.
jcs made amendment 125 20 days ago
--- main.c Wed Sep 18 10:08:52 2024
+++ main.c Fri Sep 20 20:55:14 2024
@@ -455,7 +455,10 @@ update_menu(void)
DisableItem(edit_menu, EDIT_MENU_COPY_ID);
DisableItem(edit_menu, EDIT_MENU_PASTE_ID);
- DisableItem(window_menu, WINDOW_MENU_HIDE_ID);
+ if (hidden)
+ EnableItem(window_menu, WINDOW_MENU_HIDE_ID);
+ else
+ DisableItem(window_menu, WINDOW_MENU_HIDE_ID);
}
void
@@ -494,9 +497,9 @@ wallops_about(void)
DialogPtr dp;
StringHandle dast;
VersRecHndl vers;
- Rect bounds, irect;
- short hit, vlen, n, itype;
- Handle h, ihandle, okhandle;
+ Rect bounds;
+ short hit, vlen, n;
+ Handle h, ihandle;
vers = (VersRecHndl)GetResource('vers', 1);
if (!vers)
@@ -532,10 +535,8 @@ wallops_about(void)
SetPort(dp);
ShowWindow(dp);
- GetDItem(dp, ok, &itype, &okhandle, &irect);
for (;;) {
- outline_button((ControlHandle)okhandle);
- ModalDialog(0, &hit);
+ ModalDialog(ModalDialogFilter, &hit);
if (hit == ok)
break;
}