Xaw(3)
β¨ NAME β¨
okay so this is Xaw(3), bestie β the manual page for Xaw, aka X Athena Widgets. π
π«Ά
πΈ DESCRIPTION πΈ
Xaw is a widget set based on the X Toolkit Intrinsics (Xt) Library. β¨
This release by the X.Org Foundation includes additions and modifications originally made for The XFree86 Project, Inc. This manual page describes these changes as well as some of the common interfaces between its version and the previous X Consortium release (Xaw6). π
The bulk of the Xaw documentation is located in the API specification, which may be installed in /usr/share/doc/libXaw, or found on the X.Org website. π
π₯ ACTIONS π₯
All of the Xaw widgets now have the additional translations call-proc, declare, get-values and set-values. periodt. π
The syntax for these actions is:
action-name (boolean-expression, arguments)
action-name is one of call-proc, declare, get-values or set-values.
boolean-expression is composed with the operators
|(or),&(and),^(xor), and~(not).
Its operands can be
- a variable name, which starts with a
$, - a resource name without the bindings
.or*, or - a constant name, including
mine(event->xany.window == XtWindow(widget)),faked(event->xany.send_event != 0),true(1) andfalse(0).
arguments are self-explanatory:
- when starting with a
$they name a variable, - otherwise they indicate a resource name.
π call-proc (boolean-expression, procedure-name) π
This action allows the evaluation of a boolean expression in the first parameter before calling an action procedure. The procedure is only called if the expression evaluates as true. fr fr. β¨
Example:
call-proc("$inside & $pressed", notify)
π declare (boolean-expression, variable, value, ...) π
This action is used to create new variables or change their values. Any number of variable-value tuples may be specified. no cap. π
Example:
declare(1, $pressed, 1)
π¦ get-values (boolean-expression, variable, value, ...) π¦
This action reads a widget resource value into a variable. Any number of variable-value tuples may be specified. π
Example:
get-values(1, $fg, foreground, $bg, background)
π set-values (boolean-expression, variable, value, ...) π
This action sets a widget resource to the given value, which may be a variable. Any number of variable-value tuples may be specified. slay. π₯
Example:
set-values(1, foreground, $bg, background, $fg)
Here is a sample translation to make a label widget behave like a button:
<Map>: get-values(1, $fg, foreground, $bg, background)\n\
<Btn1Down>: set-values(1, foreground, yellow, background, gray30)\n\
<Btn1Up>: set-values(1, foreground, $fg, background, $bg)
π DISPLAY LISTS π
Okay so bestie, all of the Xaw widgets have now the additional resource displayList. No cap, it's iconic. This resource allows drawing the widget decorations using commands embedded in a resource string. The displayList resource has the syntax:
[class-name:]function-name arguments[[{;\n}]...]
class-name is any registered set of functions to draw in the widget. Currently the only existing class is xlib, which provides access to the Xlib drawing primitives. Periodt.
function-name is the drawing or configuration function to be called, described below.
arguments may be anything suitable to the displayList function being called. When the function requires a coordinate, the syntax is literally this:
{+-}<integer> or
<integer>/<integer>.
Examples:
+0,+0 top, left
-0,-0 bottom, right
-+10,-+10 bottom+10, right+10
+0,1/2 left, vertical-center
Here's the whole function menu, and yes, we're doing all of them:
arc-modemode β Sets the arc mode. Accepted modes are"pieslice"and"chord", which set the arc toArcPieSliceorArcChord, respectively. Example:arc-mode chordbg,backgroundcolor-spec β Sets the background color.color-spechas to be a valid color specification. Example:background redcap-stylestyle β Sets the cap style. Accepted styles are"notlast","butt","round", and"projecting", which set the cap style toCapNotLast,CapBut,CapRoundorCapProjecting, respectively. Example:cap-style roundclip-maskpixmap-spec β Sets the pixmap for the clip mask. Requires a pixmap parameter, as described in the PIXMAPS section below. Example:clip-mask xlogo11clip-originx,y β Sets the clip x and y origin. Requires two arguments, the x and y coordinates. Example:clip-origin 10,10clip-rects,clip-rectanglesx1,y1,x2,y2 [...,xn,yn] β Sets a list of rectangles to the clip mask. The number of arguments must be a multiple of four. The arguments are coordinates. The parser calculates the width and height of the rectangles. Example:clip-rects 0,0,10,20, 20,10,30,30coord-modemode β Changes the coordinate mode forfill-polygon,draw-lines, anddraw-points. Accepted parameters are"modeorigin"and"previous", that sets the coord mode toCoordModeOriginorCoordModePrevious, respectively. Example:coord-mode previouscopy-area{pixmap-spec|.},dstx,dsty[,x2,y2,srcx,srcy] β CallsXCopyArea. The character.means copy the window contents;pixmap-specis as defined in the PIXMAPS section below.X2andy2are the coordinates of the end copy, not the width and height; if not defined, the parser calculates them.src_xandsrc_ydefault to zero. Example:copy-area Term,10,10copy-plane{pixmap-spec|.},dstx,dsty[,x2,y2,srcx,srcy,plane] β CallsXCopyPlane. The character.means copy the window contents;pixmap-specis as defined in the PIXMAPS section below.X2andy2are the coordinates of the end copy, not the width and height; if not defined, the parser calculates them.src_xandsrc_ydefault to zero. Plane defaults to one. Example:copy-plane star,10,10dashesi1[...,in] β Sets the dashes for line drawing. Accepts up to 127 arguments. Example:dashes 3,7 9,10draw-arcx1,y1,x2,y2[,start-angle,end-angle] β Draws an arc. The four first arguments are the rectangle enclosing the arc. The two remaining arguments, if specified, are the start and end angle, in degrees. Example:draw-arc +0,+0,-1,-1,0,90draw-rect,draw-rectanglex1,y1,x2,y2 β Draws a rectangle. Requires four arguments, which are the start and end coordinate pairs. Example:draw-rect +1,+1,-5,-5draw-stringx,y,"string" β Draws a text string. Requires three arguments, a x coordinate, a y coordinate, and a string. Strings that have white space can be quoted with the"character; the backslash character\can also be used, but it will be necessary escape it twice. Example:draw-string 10,10, "Hello world!"exposuresboolean β Sets graphics exposures in the GC. Allowed parameters are a integer or the strings"true","false","on"and"off". Example:exposures truefill-arcx1,y1,x2,y2[,start-angle,end-angle] β Likedraw-arc, but fills the contents of the arc with the currently selected foreground. Example:fill-arc +0,+0,-1,-1,0,180fill-poly,fill-polygonx1,y1 [...,xn,yn] β Likedraw-lines, but fills the enclosed polygon and joins the first and last point, if they are not at the same position. Example:fill-poly +0,+10, +10,+20, +30,+0fill-rect,fill-rectanglex1,y1,x2,y2 β Likedraw-rect, but fills the contents of the rectangle with the selected foreground color. Example:fill-rect +10,+10,-20,-20fill-rulerule β Sets the fill rule. Accepted parameters are"evenodd"and"winding", which set the fill rule toEvenOddRuleorWindingRule, respectively. Example:fill-rule windingfill-stylestyle β Sets the fill style. Allowed parameters are"solid","tiled","stippled"and"opaquestippled", which set the fill style toFillSolid,FillTiled,FillStippledorFillOpaqueStippled, respectively. Example:fill-style tiledfontfont-spec β Sets the font for text functions. Example:font -*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1fg,foregroundcolor-spec β Likebackground, but sets the current foreground color. Example:foreground bluemaskβ This command is useful when you want to draw only in the region that really needs to be repainted. It requires no arguments.functionfunction-spec β Sets the specific GC function. Allowed parameters are"set","clear","and","andreverse","copy","andinverted","noop","xor","or","nor","equiv","invert","orreverse","copyinverted"and"nand", which set the function toGXset,GXclear,GXand,GXandReverse,GXcopy,GXandInverted,GXnoop,GXxor,GXor,GXnor,GXequiv,GXinvert,GXorReverse,GXcopyInvertedorGXnand, respectively. Example:function xorjoin-stylestyle β Sets the join style. Allowed parameters are"miter","round"and"bevel", which set the join style toJoinMiter,JoinRoundandJoinBevel, respectively. Example:join-style roundimage{pixmap-spec},xs,ys,[xe,ye] β This function is implemented as a way to quickly compose complex decorations in widgets.Pixmap-specis as defined in the PIXMAPS section below.xsandysare the coordinates from where to start copying the pixmap;xeandyeare optional (they default toxs + pixmap.widthandys + pixmap.height, respectively). If the pixmap has a mask, the copy is masked accordingly. Example:image pixmap.xpm,0,0,20,20line,draw-linex1,y1,x2,y2 β Draws a line with the current foreground color. Requires four arguments, the starting and ending coordinate pairs. Example:line +0,+0, -1,-1line-widthinteger β Selects a line width for drawing. Example:line-width 2line-stylestyle β Sets the line style. Accepted parameters are"solid","onoffdash"and"doubledash", which set the line style toLineSolid,LineOnOffDashorLineDoubleDash, respectively. Example:line-style onoffdashlines,draw-linesx1,y1,x2,y2 [...,xn,yn] β Draws a list of lines. Any number of argument pairs may be supplied. Example:lines +0,-1, -1,-1, -1,+0paint-stringx,y,"string" β Identical todraw-string, but also uses the background color. Example:paint-string 10,20, "Sample text"point,draw-pointx,y β Draws a point. Requires two arguments, a coordinate pair. Example:point +10,+10plane-maskinteger β Sets the plane mask. Requires an integer parameter. Example:plane-mask -1points,draw-pointsx1,y1 [...,xn,yn] β Draws a list of points at the specified coordinates. Example:points +1,+2, +1,+4, +1,+6segments,draw-segmentsx1,y1,x2,y2 [...,xn,yn] β Draws a list of segment lines. The number of parameters must be multiple of 4. Example:segments +1,+2,+1,-3, +2,-2,-3,-2shape-modemode β Sets the shape mode used infill-polygon. Accepted parameters are"complex","convex"or"nonconvex", which set the shape mode toComplex,ConvexorNonconvex, accordingly. Example:shape-mode convexstipplepixmap-spec β Sets the pixmap for a stipple. Requires a pixmap parameter, as described in the PIXMAPS section below. Example:stipple plaidsubwindow-modemode β Sets the subwindow mode in the GC. Accepted parameters are"includeinferiors"and"clipbychildren", which set the subwindow mode toIncludeInferiorsorClipByChildren, respectively. Example:subwindow-mode includeinferiorstilepixmap-spec β Sets the pixmap for a tile. Requires a pixmap parameter, as described in the PIXMAPS section below. Example:tile xlogo11?foreground=red&background=gray80ts-originx,y β Sets the tile stipple x and y origin. Requires two arguments, a x and y coordinate. Example:ts-origin 10,10umaskβ Disables the GC mask, if it has been set with the commandmask. Requires no arguments.
π Example for drawing a shadow effect in a widget π
foreground gray30;\
draw-lines +1,-1,-1,-1,-1,+1;\
foreground gray85;\
draw-lines -1,+0,+0,+0,+0,-1
π¦ PIXMAPS π¦
Okay bestie, listen β Xaw got a whole glow-up: there's a String to Pixmap converter now. It's literally designed to be extended, and it's abstract enough that you can load several different image formats with it. The way it works is it uses a format that's giving very much URL energy, with this syntax:
[type:]name[?arg=val[{&}...]]
typeβ can be one ofbitmap,gradientorxpm.nameβ may be a file name, or, in the case of typegradient, may be eitherverticalorhorizontal.arg=valβ is a list of arguments to the converter.- An argument list is preceded by a question mark, and multiple arguments are separated by ampersands.
- The most common arguments are
foregroundandbackground. - Gradients also support the arguments
startandend(colors with which to start and end the gradient), thestepsargument (to allow using fewer colors), and thedimensionargument (to specify the size of the gradient). - The
xpmconverter understands theclosenessargument, which aids in using fewer colors (useful if you have a limited colormap).
π TEXT WIDGET π
Most of the changes to this version of the Xaw library were done in the TextWidget, TextSrcObject, TextSinkObject and related files. So yeah, this is where the main character energy lives. π
A couple of highly visible changes in the Text widget are due to soooo many bugs in the Xaw6 implementation involving scrollbars and auto-resizing. Like, scrollbars being added or removed caused several problems in keeping the text cursor visible, and in Xaw6 it was extremely easy to have a widget thinking the cursor was visible, when it was not. Also, permitting automatic resizing of the widget to a larger geometry created other problems, making it difficult to have a consistent layout in the application, and, if the window manager did not interfere, windows larger than the screen could result. So therefore, some functionality involving scrollbars and auto-resizing has been disabled β go check the section on new and modified Text widget resources below, bestie.
The Text widget's default key bindings were originally based on the Emacs text editor. In this release, even more operations familiar to Emacs users have been added. The new text actions are:
indentβ Indents text blocks. Not bound by default. The Text widget also does not attempt to perform auto-indentation of its source object by default.keyboard-resetβ Resets the keyboard state. Reverts the action multiplier to 1, and if undo is enabled, toggles between undo and redo. Bound by default toControl<Key>G.kill-ring-yankβ In this version of Xaw, text killed in any text field is kept in memory, allowing cut and paste operations internally to the program between text fields. Bound by default toMeta<Key>Y.numericβ Listed here only for purposes of documentation. Called by default when one of the characters1,2,3,4,5,6,7,8,9,0, or-is typed, allowing composition of the multiplication number of text actions.set-keyboard-focusβ Sets the input focus of the top level widget to the text field. Not enabled by default, but bound to the<Btn1Down>event.toggle-overwriteβ Toggles overwrite mode. In overwrite mode, any text inserted in a text field will replace existing text. Bound by default to<Key>Insert.undoβ Sets theenableUndoresource of thetextSrcObject. Not enabled by default, but bound toControl<Key>_.
β¨ New and modified Text widget resources β¨
justify(ClassJustify) β Sets the text justification. Can be one ofleft,right,center, orfull. Only enabled when theautoFillresource is set, and the resourcesleftColumnandrightColumnare correctly set.leftColumn(ClassColumn) β Specifies the left column at which to break text. Text lines started with an alphanumeric character will automatically start at this column.positionCallback(ClassCallback) β Allows installation of a callback to be called every time the cursor is moved, and/or the file changes its size. The callback is called with a pointer to a structure containing the following data:
typedef struct {
int line_number;
int column_number;
XawTextPosition insert_position;
XawTextPosition last_position;
Boolean overwrite_mode;
} XawTextPositionInfo;
This callback is intended to help programmers write text editors based on the Xaw widget set.
resize(ClassResize) β No longer supported, but recognized for backward compatibility with resource specifications written for the Xaw6 Text widget. (rip bozo, but it's still here for the old heads π)rightColumn(ClassColumn) β Specifies the right column at which to break text. Text lines started with an alphanumeric character will automatically end at this column.scrollHorizontal(ClassScroll) andscrollVertical(ClassScroll) β These resources control the placement of scrollbars on the left and bottom edges of the Text widget. They accept the valuesXawtextScrollAlwaysandXawtextScrollNever. A converter is registered for this resource that will convert the following strings:alwaysandnever. The valueXawtextScrollWhenNeeded(andwhenNeeded, recognized by the converter), is accepted for backwards compatibility with resource specifications written for the Xaw6 Text widget, but ignored (effectively treated asXawtextScrollNever).
πΈ TEXT SOURCE OBJECT πΈ
The textSrcObject allows display of its contents to more than one window, and also stores undo information. The new resources for the textSrcObject are:
callback(ClassCallback) β Previous versions of Xaw had this resource in subclasses of the TextSource object. This was changed to make it possible to tell the callback the state of the text when undo is enabled.enableUndo(ClassUndo) β A boolean resource that enables or disables the undo function. The default value isFalse.sourceChanged(ClassChanged) β Like thecallbackresource, this resource was previously in subclasses of the TextSource object. It is now in thetextSrcObjectto control the changed/unchanged state when undo is enabled.
π TEXT SINK OBJECT π
The textSinkObject subclasses asciiSinkObject and multiSinkObject have been changed slightly to use a new cursor shape (no longer a caret at the baseline) that indicates the input focus of the text widget, and allow specification of the cursor color. The new resource is:
cursorColor(ClassColor) β Sets the cursor color of the text. This color is also used to draw selected text.
π§ SIMPLE MENU WIDGET π§
The simpleMenuWidget algorithm to lay out menu entries has been changed to enable multiple columns when a single column does not fit on the screen. It was also modified to enable submenus. We love a menu that adapts. π
π SME BSB OBJECT π
A new resource has been added to the smeBSBObject to allow binding submenus to it. The new resource is:
menuName(ClassMenuName) β Specifies the name of the popup widget to be popped up when the pointer is over the menu entry, orNULL. Note that the named menu must be a child of the popup parent of thesmeBSBObject.
π AUTHORS π
The original X Consortium version of the Athena Widget Set and its documentation were the work of many people, including Chris D. Peterson, Ralph Swick, Mark Ackerman, Donna Converse, Jim Fulton, Loretta Guarino-Reid, Charles Haynes, Rich Hyde, Mary Larson, Joel McCormack, Ron Newman, Jeanne Rich, Terry Weissman, Mike Gancarz, Phil Karlton, Kathleen Langone, Ram Rao, Smokey Wallace, Al Mento, and Jean Diaz. Legends, every single one. π«Ά
The additions and modifications to Xaw which were originally made for XFree86 were written by Paulo CΓ©sar Pereira de Andrade.
π SEE ALSO π
- Athena Widget Set - C Language Interface
And that's a wrap, bestie! π This page is from X Version 11, libXaw 1.0.16, and it's the Xaw(3) manual page. Now go forth and read the Athena Widget Set docs β you got this, fr fr. πβ¨π
π¦ where this page comes from
- alpine 3.22: libxaw-doc 1.0.16-r1 Β· MIT
- alpine 3.23: libxaw-doc 1.0.16-r1 Β· MIT
- alpine 3.24: libxaw-doc 1.0.16-r1 Β· MIT
- arch rolling: libxaw 1.0.16-2 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND NTP
- fedora 43: libXaw-devel 1.0.16-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND NTP
- fedora 43: libXaw-devel 1.0.16-4.fc43 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND NTP
- fedora 44: libXaw-devel 1.0.16-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND NTP
- fedora 44: libXaw-devel 1.0.16-5.fc44 Β· MIT-open-group AND X11 AND HPND AND HPND-sell-variant AND SMLNJ AND NTP
- Copyright (c) 1999 by The XFree86 Project, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms