pull request #443 - X11 color status highlighting

for 'fancy status'.  This is from an emailed diff rather than
directly from git, and the git code has a bunch of commits,
so this may or may not match the latest.  It needs formatting
cleanup and triggers a couple of warnings on OSX.  Fix to follow.

Status highlight colors use the same names as menu coloring
but this uses different X11 colors for the two sets.  That
will have to be changed so that yellow either means yellow all
the time or goldenrod all the time instead of sometimes yellow
and sometimes goldenrod.

Adopts #443
This commit is contained in:
PatR
2021-01-26 13:39:50 -08:00
parent ea12c70e46
commit acbf423734
3 changed files with 197 additions and 81 deletions
+12 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 winval.c $NHDT-Date: 1596498377 2020/08/03 23:46:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.10 $ */
/* NetHack 3.7 winval.c $NHDT-Date: 1611697183 2021/01/26 21:39:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $ */
/* Copyright (c) Dean Luick, 1992 */
/* NetHack may be freely redistributed. See license for details. */
@@ -114,6 +114,13 @@ Widget w;
return (int) width;
}
Widget
get_value_widget(w)
Widget w;
{
return XtNameToWidget(w, WVALUE);
}
void
set_value(w, new_value)
Widget w;
@@ -122,7 +129,7 @@ const char *new_value;
Arg args[1];
Widget val;
val = XtNameToWidget(w, WVALUE);
val = get_value_widget(w);
XtSetArg(args[0], XtNlabel, new_value);
XtSetValues(val, args, ONE);
}
@@ -135,7 +142,7 @@ int new_width;
Arg args[1];
Widget val;
val = XtNameToWidget(w, WVALUE);
val = get_value_widget(w);
XtSetArg(args[0], XtNwidth, new_width);
XtSetValues(val, args, ONE);
}
@@ -148,7 +155,7 @@ Widget w;
Widget val;
Dimension width;
val = XtNameToWidget(w, WVALUE);
val = get_value_widget(w);
XtSetArg(args[0], XtNwidth, &width);
XtGetValues(val, args, ONE);
return (int) width;
@@ -160,7 +167,7 @@ void
hilight_value(w)
Widget w;
{
swap_fg_bg(XtNameToWidget(w, WVALUE));
swap_fg_bg(get_value_widget(w));
}
/* Swap the foreground and background colors of the given widget */