http://invisible-island.net/athena_widgets/XawPlus

_________________________________________________________XawPlus

The StripChart Widget

Application Header file
Class Header file
Class
Class Name
Superclass
<X11/XawPlus/StripChart.h>
<X11/XawPlus/StripChartP.h>
stripChartWidgetClass
StripChart
Simple

The StripChart widget is used to provide a real time graphical chart of a single value. This widget is used by xload to provide the load graph. It will read data from an application, and update the chart at the update interval specified.

Differences between Xaw and XawPlus

Since the 3D extensions of Simple are inserted, the StripChart widget has the additional (but at this time not used) resources highlightColor, shadowColor and buttonBorderWidth. The default background color is now grey75.

Resources

When creating a Simple widget instance, the following resources are retrieved from the argument list of XtSetValues() or XtVaSetValues() or from the resource database:

Name Class Type Default Value
OBJECT:
destroyCallback Callback Pointer NULL
RECTANGLE:
borderWidth
height
sensitive
width
x
y
BorderWidth
Height
Sensitive
Width
Position
Position
Dimension
Dimension
Boolean
Dimension
Position
Position
0
120
True
120
0
0
CORE:
border
background
mappedWhenManaged
BorderColor
Background
MappedWhenManaged
Pixel
Pixel
Boolean
XtDefaultForeground
grey75
True
SIMPLE:
cursor
cursorName
pointerColor
pointerColorBackground
insensitiveBorder
international
highlightColor
shadowColor
buttonBorderWidth
Cursor
Cursor
Foreground
Background
Insensitive
International
Background
Background
Width
Cursor
String
Pixel
Pixel
Pixmap
Boolean
Pixel
Pixel
Dimension
None
NULL
XtDefaultForeground
XtDefaultBackground
NULL
False
grey90
grey40
2
STRIPCHART:
foreground
getValue
highlight
jumpScroll
minScale
update
Foreground
Callback
Foreground
JumpScroll
Scale
Interval
Pixel
XtCallbackList
Pixel
int
int
int
XtDefaultForeground
NULL
XtDefaultForeground
1/2 width
1
10 (seconds)
foreground A pixel value which indexes the widget's colormap to derive the color that will be used to draw the graph.
getValue This is a list of functions to call every update seconds. This function will get the value to be graphed by the StripChart widget. The section Getting the StripChart Value will describe the calling interface in more detail. This callback list should contain only one function. If this callback list contains more than one function, the behavior is undefined.
highlight A pixel value which indexes the widget's colormap to derive the color that will be used to draw the scale lines on the graph.
jumpScroll When the graph reaches the right edge of the window it must be scrolled to the left. This resource specifies the number of pixels it will jump. Smooth scrolling can be achieved by setting this resource to 1.
minScale The minimum scale for the graph. The number of divisions on the graph will always be greater than or equal to this value.
update The number of seconds between graph updates. Each update is represented on the graph as a 1 pixel wide line. Every update seconds the getValue procedure will be used to get a new graph point, and this point will be added to the right end of the StripChart.

Getting The StripChart Value

The StripChart widget will call the application routine passed to it as the getValue callback function every update seconds to obtain another point for the StripChart graph.

The calling interface for the getValue callback is:

void (*getValueProc)(w, client_data, value)
Widget w;
XtPointer client_data;
XtPointer value; /* double * */

w Specifies the StripChart widget.
client_data Specifies the client data.
value Returns a pointer to a double. The application should set the address pointed to by this argument to a double containing the value to be graphed on the StripChart.

This function is used by the StripChart to call an application routine. The routine will pass the value to be graphed back to the the StripChart in the value field of this routine.

XawPlus_________________________________________________________