\input wbuildmac.tex
\Class{XfwfArrow}
 The Arrow widget is usually part of a composite scrollbar widget. It
draws a triangle pointing up, down, left or right, depending on the
{\tt direction} resource. It has a single callback, that is repeatedly
called as long as a mouse button -- button 1 by default -- is pressed.

The triangle has a 3D shadow, the size of which can be controlled with
a resource. The shadow is either stippled or colored, depending on the
{\tt shadowScheme} and associated resources (see the XfwfFrame widget).



\Publicvars
\Table{XfwfArrow}
XtNdirection&XtCDirection&Alignment &XfwfTop \cr
XtNforeground&XtCForeground&Pixel &XtDefaultBackground \cr
XtNarrowShadow&XtCArrowShadow&Dimension &2 \cr
XtNinitialDelay&XtCInitialDelay&Cardinal &500 \cr
XtNrepeatDelay&XtCRepeatDelay&Cardinal &200 \cr
XtNcallback&XtCCallback&Callback&NULL \cr
\endTable
\Section
\Publicvar{XtNdirection}
 The direction of the arrow (triangle) is given by the {\tt direction}
resource, which is of type {\tt Alignment}. Only {\tt "top"} ({\tt XfwfTop}),
{\tt "bottom"} ({\tt XfwfBottom}), {\tt "left"} ({\tt XfwfLeft}) and {\tt "right"}
({\tt XfwfRight}) are valid directions. Other directions result in a
warning.



\HCode
\Code
Alignment  direction = XfwfTop \endCode
\endHCode


\Section
\Publicvar{XtNforeground}
 The color of the arrow also determines the color of the 3D shadow,
at least if {\tt shadowScheme} is set to {\tt XfwfAuto}, as it is by default.



\HCode
\Code
Pixel  foreground = {\langle}String{\rangle}XtDefaultBackground \endCode
\endHCode


\Section
\Publicvar{XtNarrowShadow}
 The width of the arrow's shadow is by default 2 pixels.



\HCode
\Code
Dimension  arrowShadow = 2 \endCode
\endHCode


\Section
\Publicvar{XtNinitialDelay}
 When the user presses and then holds the mouse button, the action
function waits some milliseconds before it starts repeating the
callbacks.



\HCode
\Code
Cardinal  initialDelay = 500 \endCode
\endHCode


\Section
\Publicvar{XtNrepeatDelay}
 Between repeated calls to the callback routines, the arrow widget
will wait a few milliseconds.



\HCode
\Code
Cardinal  repeatDelay = 200 \endCode
\endHCode


\Section
\Publicvar{XtNcallback}
 The {\tt callback} function is called by the {\tt activate} action. It is
called repeatedly until the mouse button that triggered the action is
released again.



\HCode
\Code
{\langle}Callback{\rangle} XtCallbackList  callback = NULL \endCode
\endHCode


\End\Table{XfwfBoard}
XtNcursor&XtCCursor&Cursor &None \cr
XtNabs{\underline}x&XtCAbs{\underline}x&Int &0 \cr
XtNrel{\underline}x&XtCRel{\underline}x&Float &"0.0"\cr
XtNabs{\underline}y&XtCAbs{\underline}y&Int &0 \cr
XtNrel{\underline}y&XtCRel{\underline}y&Float &"0.0"\cr
XtNabs{\underline}width&XtCAbs{\underline}width&Int &0 \cr
XtNrel{\underline}width&XtCRel{\underline}width&Float &"1.0"\cr
XtNabs{\underline}height&XtCAbs{\underline}height&Int &0 \cr
XtNrel{\underline}height&XtCRel{\underline}height&Float &"1.0"\cr
XtNhunit&XtCHunit&Int &1 \cr
XtNvunit&XtCVunit&Int &1 \cr
XtNlocation&XtCLocation&String &NULL \cr
\endTable
\Table{XfwfFrame}
XtNframeType&XtCFrameType&FrameType &XfwfRaised \cr
XtNframeWidth&XtCFrameWidth&Dimension &0 \cr
XtNframeOffset&XtCFrameOffset&Dimension &0 \cr
XtNshadowScheme&XtCShadowScheme&ShadowScheme &XfwfAuto \cr
XtNlightColor&XtCLightColor&Pixel &XtDefaultBackground \cr
XtNdarkColor&XtCDarkColor&Pixel &XtDefaultForeground \cr
XtNlightStipple&XtCLightStipple&Bitmap &NULL \cr
XtNdarkStipple&XtCDarkStipple&Bitmap &NULL \cr
\endTable
\Table{XfwfCommon}
XtNhighlighted&XtCHighlighted&Boolean &False \cr
XtNselected&XtCSelected&Boolean &False \cr
XtNtext&XtCText&String &NULL \cr
XtNhandlers&XtCHandlers&Program *&NULL \cr
\endTable
\Table{Composite}
XtNchildren&XtCChildren&WidgetList &NULL \cr
insertPosition&XtCInsertPosition&XTOrderProc &NULL \cr
numChildren&XtCNumChildren&Cardinal &0 \cr
\endTable
\Table{Core}
XtNx&XtCX&Position &0 \cr
XtNy&XtCY&Position &0 \cr
XtNwidth&XtCWidth&Dimension &0 \cr
XtNheight&XtCHeight&Dimension &0 \cr
borderWidth&XtCBorderWidth&Dimension &0 \cr
XtNcolormap&XtCColormap&Colormap &NULL \cr
XtNdepth&XtCDepth&Int &0 \cr
destroyCallback&XtCDestroyCallback&XTCallbackList &NULL \cr
XtNsensitive&XtCSensitive&Boolean &True \cr
XtNtranslations&XtCTranslations&XTTranslations &NULL \cr
ancestorSensitive&XtCAncestorSensitive&Boolean &False \cr
accelerators&XtCAccelerators&XTTranslations &NULL \cr
borderColor&XtCBorderColor&Pixel &0 \cr
borderPixmap&XtCBorderPixmap&Pixmap &NULL \cr
background&XtCBackground&Pixel &0 \cr
backgroundPixmap&XtCBackgroundPixmap&Pixmap &NULL \cr
mappedWhenManaged&XtCMappedWhenManaged&Boolean &True \cr
XtNscreen&XtCScreen&Screen *&NULL \cr
\endTable
\Translations
\Section


\Code
{\langle}Btn1Down{\rangle}: activate{\underline}and{\underline}start{\underline}timer() \endCode


\Section


\Code
{\langle}Btn1Up{\rangle}: stop{\underline}timer() \endCode


\End\Actions
\Section
\Action{activate{\underline}and{\underline}start{\underline}timer} The {\tt activate} action calls the {\tt callback} routine once and installs
a timeout routine.



\HCode
\Code
void activate{\underline}and{\underline}start{\underline}timer({\dollar}, XEvent* event, String* params, Cardinal* num{\underline}params)
{\lbrace}
    if (event-{\rangle}type != ButtonPress) {\lbrace}
        XtWarning("The Arrow activate action isn't bound to a BtnDown event");
	return;
    {\rbrace}
    XtCallCallbackList({\dollar}, {\dollar}callback, NULL);
    {\dollar}timer = XtAppAddTimeOut(XtWidgetToApplicationContext({\dollar}),
			     {\dollar}initialDelay, timer{\underline}callback, {\dollar});
{\rbrace}\endCode
\endHCode


\Section
\Action{stop{\underline}timer}

\HCode
\Code
void stop{\underline}timer({\dollar}, XEvent* event, String* params, Cardinal* num{\underline}params)
{\lbrace}
    XtRemoveTimeOut({\dollar}timer);
{\rbrace}\endCode
\endHCode


\End\Imports
\Section
 The stipple for the shadows are loaded from a bitmap file.



\Code
{\incl} "stip4.bm"\endCode


\Section


\Code
{\incl} {\langle}stdio.h{\rangle}\endCode


\Section


\Code
{\incl} {\langle}assert.h{\rangle}\endCode


\End\Privatevars
\Section
 The three GC's are used for drawing the arrow and its shadows.



\Code
GC  arrowgc\endCode


\Section


\Code
GC  arrowlightgc\endCode


\Section


\Code
GC  arrowdarkgc\endCode


\Section
 The repeating callback is implemented with a time out routine. The
timer is a private variable of the widget.



\Code
XtIntervalId  timer\endCode


\End\Methods
\Section
 The {\tt initialize} method sets initial values for the three GC's and
checks the {\tt direction} resource.



\Code
initialize(Widget  request, {\dollar}, ArgList  args, Cardinal * num{\underline}args)
{\lbrace}
    if ({\dollar}direction != XfwfTop {\ampersand}{\ampersand} {\dollar}direction != XfwfLeft
	{\ampersand}{\ampersand} {\dollar}direction != XfwfRight {\ampersand}{\ampersand} {\dollar}direction != XfwfBottom) {\lbrace}
	XtWarning("direction of Arrow widget incorrect; set to `top'");
	{\dollar}direction = XfwfTop;
    {\rbrace}
    {\dollar}arrowgc = NULL; create{\underline}arrowgc({\dollar});
    {\dollar}arrowlightgc = NULL; create{\underline}arrowlightgc({\dollar});
    {\dollar}arrowdarkgc = NULL; create{\underline}arrowdarkgc({\dollar});
{\rbrace}\endCode


\Section
 When the {\tt foreground}, {\tt arrowShadow} or {\tt direction} resource changes,
the widget has to be redrawn. Like in the {\tt initialize} method, the
{\tt direction} resource needs to be checked for valid values.

If the inherited resource {\tt shadowScheme} or one of its family changes, new
GC's need to be created.



\Code
Boolean  set{\underline}values(Widget  old, Widget  request, {\dollar}, ArgList  args, Cardinal * num{\underline}args)
{\lbrace}
    Boolean need{\underline}redisplay = False;

    if ({\dollar}direction != XfwfTop {\ampersand}{\ampersand} {\dollar}direction != XfwfLeft
	{\ampersand}{\ampersand} {\dollar}direction != XfwfRight {\ampersand}{\ampersand} {\dollar}direction != XfwfBottom) {\lbrace}
	XtWarning("direction of Arrow widget incorrect; set to `top'");
	{\dollar}direction = XfwfTop;
    {\rbrace}
    if ({\dollar}old{\dollar}direction != {\dollar}direction)
	need{\underline}redisplay = True;
    if ({\dollar}old{\dollar}foreground != {\dollar}foreground) {\lbrace}
	create{\underline}arrowgc({\dollar});
	need{\underline}redisplay = True;
    {\rbrace}
    if ({\dollar}old{\dollar}arrowShadow != {\dollar}arrowShadow)
	need{\underline}redisplay = True;
    if ({\dollar}shadowScheme != {\dollar}old{\dollar}shadowScheme) {\lbrace}
	create{\underline}arrowdarkgc({\dollar});
	create{\underline}arrowlightgc({\dollar});
	need{\underline}redisplay = True;
    {\rbrace} else if ({\dollar}shadowScheme == XfwfColor) {\lbrace}
	if ({\dollar}lightColor != {\dollar}old{\dollar}lightColor) {\lbrace}
	    create{\underline}arrowlightgc({\dollar});
	    need{\underline}redisplay = True;
	{\rbrace}
	if ({\dollar}darkColor != {\dollar}old{\dollar}darkColor) {\lbrace}
	    create{\underline}arrowdarkgc({\dollar});
	    need{\underline}redisplay = True;
	{\rbrace}
    {\rbrace} else if ({\dollar}shadowScheme = XfwfStipple) {\lbrace}
	if ({\dollar}lightStipple != {\dollar}old{\dollar}lightStipple) {\lbrace}
	    create{\underline}arrowlightgc({\dollar});
	    need{\underline}redisplay = True;
	{\rbrace}
	if ({\dollar}darkStipple != {\dollar}old{\dollar}darkStipple) {\lbrace}
	    create{\underline}arrowdarkgc({\dollar});
	    need{\underline}redisplay = True;
	{\rbrace}
    {\rbrace}
    return need{\underline}redisplay;
{\rbrace}\endCode


\Section
 The arrow is drawn as large as possible. The arrow is actually a triangle
with 3D shadows. {\tt p1} is the triangle itself, {\tt p2}, {\tt p3} and {\tt p4} are the
shadows.



\Macro
point(p, i, xx, yy) =
(p[i ].x =xx ),(p[i ].y =yy )\endMacro


\Section


\Code
expose({\dollar}, XEvent * event, Region  region)
{\lbrace}
    XPoint p1[3], p2[4], p3[4], p4[4];
    Position x, y;
    Dimension width, height, a, a2, a3;

    assert({\dollar}direction == XfwfTop {\bar}{\bar} {\dollar}direction == XfwfLeft
	   {\bar}{\bar} {\dollar}direction == XfwfRight {\bar}{\bar} {\dollar}direction == XfwfBottom);

    if (! XtIsRealized({\dollar})) return;
    if (region != NULL) {\lbrace}
	XSetRegion(XtDisplay({\dollar}), {\dollar}arrowgc, region);
	XSetRegion(XtDisplay({\dollar}), {\dollar}arrowlightgc, region);
	XSetRegion(XtDisplay({\dollar}), {\dollar}arrowdarkgc, region);
    {\rbrace}
    {\dollar}compute{\underline}inside({\dollar}, {\ampersand}x, {\ampersand}y, {\ampersand}width, {\ampersand}height);
    a = {\dollar}arrowShadow;
    switch ({\dollar}direction) {\lbrace}
    case XfwfTop:
	a2 = (1.0 + 0.71*width/height) * a;
	a3 = (1.0 + 0.83*height/width) * a;
	point(p1, 0, x + width/2,	y + a3);
	point(p1, 1, x + a2,		y + height - a);
	point(p1, 2, x + width - a2,	y + height - a);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowgc, p1, 3, Convex,
		     CoordModeOrigin);
	if (a == 0) break;
	point(p2, 0, x + width/2,	y);
	point(p2, 1, x + width/2,	y + a3);
	point(p2, 2, x + width - a2,	y + height - a);
	point(p2, 3, x + width,		y + height);

	point(p3, 0, x + a2,		y + height - a);
	point(p3, 1, x,			y + height);
	point(p3, 2, x + width,		y + height);
	point(p3, 3, x + width - a2,	y + height - a);

	point(p4, 0, x + width/2,	y);
	point(p4, 1, x,			y + height);
	point(p4, 2, x + a2,		y + height - a);
	point(p4, 3, x + width/2,	y + a3);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p2, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p3, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p4, 4, Convex,
		     CoordModeOrigin);
	break;
    case XfwfLeft:
	a2 = (1.0 + 0.83*width/height) * a;
	a3 = (1.0 + 0.71*height/width) * a;
	point(p1, 0, x + a2,		y + height/2);
	point(p1, 1, x + width - a,	y + a3);
	point(p1, 2, x + width - a,	y + height - a3);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowgc, p1, 3, Convex,
		     CoordModeOrigin);
	if ({\dollar}arrowShadow == 0) break;
	point(p2, 0, x + width,		y);
	point(p2, 1, x,			y + height/2);
	point(p2, 2, x + a2,		y + height/2);
	point(p2, 3, x + width - a,	y + a3);

	point(p3, 0, x,			y + height/2);
	point(p3, 1, x + width,		y + height);
	point(p3, 2, x + width - a,	y + height - a3);
	point(p3, 3, x + a2,		y + height/2);

	point(p4, 0, x + width,		y);
	point(p4, 1, x + width - a,	y + a3);
	point(p4, 2, x + width - a,	y + height - a3);
	point(p4, 3, x + width,		y + height);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p2, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p3, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p4, 4, Convex,
		     CoordModeOrigin);
	break;
    case XfwfBottom:
	a2 = (1.0 + 0.71*width/height) * a;
	a3 = (1.0 + 0.83*height/width) * a;
	point(p1, 0, x + width/2,	y + height - a3);
	point(p1, 1, x + a2,		y + a);
	point(p1, 2, x + width - a2,	y + a);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowgc, p1, 3, Convex,
		     CoordModeOrigin);
	if ({\dollar}arrowShadow == 0) break;
	point(p2, 0, x,			y);
	point(p2, 1, x + width/2,	y + height);
	point(p2, 2, x + width/2,	y + height - a3);
	point(p2, 3, x + a2,		y + a);

	point(p3, 0, x + width,		y);
	point(p3, 1, x + width - a2,	y + a);
	point(p3, 2, x + width/2,	y + height - a3);
	point(p3, 3, x + width/2,	y + height);

	point(p4, 0, x,			y);
	point(p4, 1, x + a2,		y + a);
	point(p4, 2, x + width - a2,	y + a);
	point(p4, 3, x + width,		y);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p2, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p3, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p4, 4, Convex,
		     CoordModeOrigin);
	break;
    case XfwfRight:
	a2 = (1.0 + 0.83*width/height) * a;
	a3 = (1.0 + 0.71*height/width) * a;
	point(p1, 0, x + width - {\dollar}arrowShadow,	y + height/2);
	point(p1, 1, x + {\dollar}arrowShadow,		y + {\dollar}arrowShadow);
	point(p1, 2, x + {\dollar}arrowShadow,		y + height - {\dollar}arrowShadow);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowgc, p1, 3, Convex,
		     CoordModeOrigin);
	if ({\dollar}arrowShadow == 0) break;
	point(p2, 0, x,			y + height);
	point(p2, 1, x + width,		y + height/2);
	point(p2, 2, x + width - a2,	y + height/2);
	point(p2, 3, x + a,		y + height - a3);

	point(p3, 0, x,			y);
	point(p3, 1, x + a,		y + a3);
	point(p3, 2, x + width - a2,	y + height/2);
	point(p3, 3, x + width,		y + height/2);

	point(p4, 0, x,			y);
	point(p4, 1, x,			y + height);
	point(p4, 2, x + a,		y + height - a3);
	point(p4, 3, x + a,		y + a3);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowdarkgc, p2, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p3, 4, Convex,
		     CoordModeOrigin);
	XFillPolygon(XtDisplay({\dollar}), {\dollar}window, {\dollar}arrowlightgc, p4, 4, Convex,
		     CoordModeOrigin);
	break;
    {\rbrace}
    if (region != NULL) {\lbrace}
	XSetClipMask(XtDisplay({\dollar}), {\dollar}arrowgc, None);
	XSetClipMask(XtDisplay({\dollar}), {\dollar}arrowlightgc, None);
	XSetClipMask(XtDisplay({\dollar}), {\dollar}arrowdarkgc, None);
    {\rbrace}
{\rbrace}\endCode


\End\Utilities
\Section
 The time-out calls the {\tt timer{\underline}callback} routine.  The routine
re-installs the time-out and calls the {\tt callback} function (but in the
reverse order, because we do not want time-outs to overtake each
other). The delay is now {\tt repeatDelay} instead of {\tt initialDelay}.



\Code
timer{\underline}callback(XtPointer  client{\underline}data, XtIntervalId * timer)
{\lbrace}
    Widget {\dollar} = (Widget) client{\underline}data;

    XtCallCallbackList({\dollar}, {\dollar}callback, NULL);
    {\dollar}timer = XtAppAddTimeOut(XtWidgetToApplicationContext({\dollar}),
			     {\dollar}repeatDelay, timer{\underline}callback, {\dollar});
{\rbrace}\endCode


\Section
 The GC for the triangle is created by a utility function. It destroys the
old GC and then creates a new one, based on the {\tt foreground} resource.



\Code
create{\underline}arrowgc({\dollar})
{\lbrace}
    XtGCMask mask;
    XGCValues values;

    if ({\dollar}arrowgc != NULL) XtReleaseGC({\dollar}, {\dollar}arrowgc);
    mask = GCForeground;
    values.foreground = {\dollar}foreground;
    {\dollar}arrowgc = XtGetGC({\dollar}, mask, {\ampersand}values);
{\rbrace}\endCode


\Section
 The GC for the light shadow is dependent on the inherited {\tt shadowScheme}
resource. It is the same routine as for the shadows in the XfwfFrame widget.



\Code
create{\underline}arrowlightgc({\dollar})
{\lbrace}
    XtGCMask mask;
    XGCValues values;

    if ({\dollar}arrowlightgc != NULL) XtReleaseGC({\dollar}, {\dollar}arrowlightgc);
    switch ({\dollar}shadowScheme) {\lbrace}
    case XfwfColor:
	mask = GCForeground;
	values.foreground = {\dollar}lightColor;
	break;
    case XfwfStipple:
	mask = GCFillStyle {\bar} GCStipple {\bar} GCForeground {\bar} GCBackground;
	values.fill{\underline}style = FillOpaqueStippled;
	values.background = {\dollar}background{\underline}pixel;
	values.stipple = {\dollar}lightStipple;
	values.foreground = WhitePixelOfScreen(XtScreen({\dollar}));
	break;
    case XfwfAuto:
	if (DefaultDepthOfScreen(XtScreen({\dollar})) {\rangle} 4
	    {\ampersand}{\ampersand} {\dollar}lighter{\underline}color({\dollar}, {\dollar}foreground, {\ampersand}values.foreground)) {\lbrace}
	    mask = GCForeground;
	{\rbrace} else {\lbrace}
	    mask = GCFillStyle {\bar} GCBackground {\bar} GCForeground {\bar} GCStipple;
	    values.fill{\underline}style = FillOpaqueStippled;
	    values.background = {\dollar}foreground;
	    values.foreground = WhitePixelOfScreen(XtScreen({\dollar}));
	    values.stipple =
		XCreateBitmapFromData(XtDisplay({\dollar}),
				      RootWindowOfScreen(XtScreen({\dollar})),
				      stip4{\underline}bits, stip4{\underline}width, stip4{\underline}height);
	{\rbrace}
	break;
    {\rbrace}
    {\dollar}arrowlightgc = XtGetGC({\dollar}, mask, {\ampersand}values);
{\rbrace}\endCode


\Section
 The routine for the dark part of the shadow is analogous.



\Code
create{\underline}arrowdarkgc({\dollar})
{\lbrace}
    XtGCMask mask;
    XGCValues values;

    if ({\dollar}arrowdarkgc != NULL) XtReleaseGC({\dollar}, {\dollar}arrowdarkgc);
    switch ({\dollar}shadowScheme) {\lbrace}
    case XfwfColor:
	mask = GCForeground;
	values.foreground = {\dollar}darkColor;
	break;
    case XfwfStipple:
	mask = GCFillStyle {\bar} GCStipple {\bar} GCForeground {\bar} GCBackground;
	values.fill{\underline}style = FillOpaqueStippled;
	values.stipple = {\dollar}darkStipple;
	values.foreground = BlackPixelOfScreen(XtScreen({\dollar}));
	values.background = {\dollar}background{\underline}pixel;
	break;
    case XfwfAuto:
	if (DefaultDepthOfScreen(XtScreen({\dollar})) {\rangle} 4
	    {\ampersand}{\ampersand} {\dollar}darker{\underline}color({\dollar}, {\dollar}foreground, {\ampersand}values.foreground)) {\lbrace}
	    mask = GCForeground;
	{\rbrace} else {\lbrace}
	    mask = GCFillStyle {\bar} GCBackground {\bar} GCForeground {\bar} GCStipple;
	    values.fill{\underline}style = FillOpaqueStippled;
	    values.background = {\dollar}foreground;
	    values.foreground = WhitePixelOfScreen(XtScreen({\dollar}));
	    values.stipple =
		XCreateBitmapFromData(XtDisplay({\dollar}),
				      RootWindowOfScreen(XtScreen({\dollar})),
				      stip4{\underline}bits, stip4{\underline}width, stip4{\underline}height);
	{\rbrace}
	break;
    {\rbrace}
    {\dollar}arrowdarkgc = XtGetGC({\dollar}, mask, {\ampersand}values);
{\rbrace}\endCode


\End\bye
