1994689c1Smrg<sect1 id="StripChart_Widget">
2994689c1Smrg<title>StripChart Widget</title>
3994689c1Smrg<!-- .XS -->
4994689c1Smrg<!-- 	StripChart Widget -->
5994689c1Smrg<!-- .XE -->
65ec34c4cSmrg<indexterm significance="preferred"><primary>StripChart widget</primary></indexterm>
7994689c1Smrg<literallayout class="monospaced">
8994689c1Smrg<!-- .TA 2.0i -->
9994689c1Smrg<!-- .ta 2.0i -->
10994689c1Smrg<!-- .sp -->
11994689c1SmrgApplication Header file	&lt;Xaw/StripChart.h&gt;
125ec34c4cSmrg<indexterm><primary>StripChart.h</primary></indexterm>
13994689c1SmrgClass Header file	&lt;Xaw/StripCharP.h&gt;
145ec34c4cSmrg<indexterm><primary>StripCharP.h</primary></indexterm>
15994689c1SmrgClass		stripChartWidgetClass
165ec34c4cSmrg<indexterm><primary>stripChartWidgetClass</primary></indexterm>
17994689c1SmrgClass Name	StripChart
185ec34c4cSmrg<indexterm><primary>StripChart widget</primary><secondary>class name</secondary></indexterm>
19994689c1SmrgSuperclass	Simple
20994689c1Smrg<!-- .sp -->
21994689c1Smrg</literallayout>
22994689c1Smrg<para>
23994689c1Smrg<!-- .LP -->
24994689c1SmrgThe StripChart widget is used to provide a roughly real
25994689c1Smrgtime graphical chart of a single value.  For example,
26994689c1Smrgit is used by the common client program <function>xload</function>
27994689c1Smrgto provide a graph of processor load.  The StripChart
28994689c1Smrgreads data from an application, and updates the chart
29994689c1Smrgat the <function>update</function> interval specified.
30994689c1Smrg</para>
31421c997bSmrg<sect2 id='StripChart::Resources'>
32994689c1Smrg<title>Resources</title>
33994689c1Smrg<para>
34994689c1Smrg<!-- .LP -->
35994689c1SmrgWhen creating a StripChart widget instance, the following resources are
36994689c1Smrgretrieved from the argument list or from the resource database:
37994689c1Smrg</para>
38994689c1Smrg<para>
39994689c1Smrg<!-- .LP -->
405ec34c4cSmrg<indexterm><primary>StripChart widget</primary><secondary>resources</secondary></indexterm>
41994689c1Smrg<informaltable>
42994689c1Smrg  <tgroup cols='5' align='center'>
43994689c1Smrg  <colspec colname='c1'/>
44994689c1Smrg  <colspec colname='c2'/>
45994689c1Smrg  <colspec colname='c3'/>
46994689c1Smrg  <colspec colname='c4'/>
47994689c1Smrg  <colspec colname='c5'/>
48994689c1Smrg  <thead>
49994689c1Smrg    <row>
50994689c1Smrg      <entry>Name</entry>
51994689c1Smrg      <entry>Class</entry>
52994689c1Smrg      <entry>Type</entry>
53994689c1Smrg      <entry>Notes</entry>
54994689c1Smrg      <entry>Default Value</entry>
55994689c1Smrg    </row>
56994689c1Smrg  </thead>
57994689c1Smrg  <tbody>
58994689c1Smrg    <row>
59994689c1Smrg      <entry>accelerators</entry>
60994689c1Smrg      <entry>Accelerators</entry>
61994689c1Smrg      <entry>AcceleratorTable</entry>
62994689c1Smrg      <entry></entry>
63994689c1Smrg      <entry>NULL</entry>
64994689c1Smrg    </row>
65994689c1Smrg    <row>
66994689c1Smrg      <entry>ancestorSensitive</entry>
67994689c1Smrg      <entry>AncestorSensitive</entry>
68994689c1Smrg      <entry>Boolean</entry>
69994689c1Smrg      <entry>D</entry>
70994689c1Smrg      <entry>True</entry>
71994689c1Smrg    </row>
72994689c1Smrg    <row>
73994689c1Smrg      <entry>background</entry>
74994689c1Smrg      <entry>Background</entry>
75994689c1Smrg      <entry>Pixel</entry>
76994689c1Smrg      <entry></entry>
77994689c1Smrg      <entry>XtDefaultBackground</entry>
78994689c1Smrg    </row>
79994689c1Smrg    <row>
80994689c1Smrg      <entry>backgroundPixmap</entry>
81994689c1Smrg      <entry>Pixmap</entry>
82994689c1Smrg      <entry>Pixmap</entry>
83994689c1Smrg      <entry></entry>
84994689c1Smrg      <entry>XtUnspecifiedPixmap</entry>
85994689c1Smrg    </row>
86994689c1Smrg    <row>
87994689c1Smrg      <entry>borderColor</entry>
88994689c1Smrg      <entry>BorderColor</entry>
89994689c1Smrg      <entry>Pixel</entry>
90994689c1Smrg      <entry></entry>
91994689c1Smrg      <entry>XtDefaultForeground</entry>
92994689c1Smrg    </row>
93994689c1Smrg    <row>
94994689c1Smrg      <entry>borderPixmap</entry>
95994689c1Smrg      <entry>Pixmap</entry>
96994689c1Smrg      <entry>Pixmap</entry>
97994689c1Smrg      <entry></entry>
98994689c1Smrg      <entry>XtUnspecifiedPixmap</entry>
99994689c1Smrg    </row>
100994689c1Smrg    <row>
101994689c1Smrg      <entry>borderWidth</entry>
102994689c1Smrg      <entry>BorderWidth</entry>
103994689c1Smrg      <entry>Dimension</entry>
104994689c1Smrg      <entry></entry>
105994689c1Smrg      <entry>1</entry>
106994689c1Smrg    </row>
107994689c1Smrg    <row>
108994689c1Smrg      <entry>colormap</entry>
109994689c1Smrg      <entry>Colormap</entry>
110994689c1Smrg      <entry>Colormap</entry>
111994689c1Smrg      <entry></entry>
112994689c1Smrg      <entry>Parent's Colormap</entry>
113994689c1Smrg    </row>
114994689c1Smrg    <row>
115994689c1Smrg      <entry>cursor</entry>
116994689c1Smrg      <entry>Cursor</entry>
117994689c1Smrg      <entry>Cursor</entry>
118994689c1Smrg      <entry></entry>
119994689c1Smrg      <entry>None</entry>
120994689c1Smrg    </row>
121994689c1Smrg    <row>
122994689c1Smrg      <entry>cursorName</entry>
123994689c1Smrg      <entry>Cursor</entry>
124994689c1Smrg      <entry>String</entry>
125994689c1Smrg      <entry></entry>
126994689c1Smrg      <entry>NULL</entry>
127994689c1Smrg    </row>
128994689c1Smrg    <row>
129994689c1Smrg      <entry>depth</entry>
130994689c1Smrg      <entry>Depth</entry>
131994689c1Smrg      <entry>int</entry>
132994689c1Smrg      <entry>C</entry>
133994689c1Smrg      <entry>Parent's Depth</entry>
134994689c1Smrg    </row>
135994689c1Smrg    <row>
136994689c1Smrg      <entry>destroyCallback</entry>
137994689c1Smrg      <entry>Callback</entry>
138994689c1Smrg      <entry>XtCallbackList</entry>
139994689c1Smrg      <entry></entry>
140994689c1Smrg      <entry>NULL</entry>
141994689c1Smrg    </row>
142994689c1Smrg    <row>
143994689c1Smrg      <entry>foreground</entry>
144994689c1Smrg      <entry>Foreground</entry>
145994689c1Smrg      <entry>Pixel</entry>
146994689c1Smrg      <entry></entry>
147994689c1Smrg      <entry>XtDefaultForeground</entry>
148994689c1Smrg    </row>
149994689c1Smrg    <row>
150994689c1Smrg      <entry>getValue</entry>
151994689c1Smrg      <entry>Callback</entry>
152994689c1Smrg      <entry>XtCallbackList</entry>
153994689c1Smrg      <entry></entry>
154994689c1Smrg      <entry>NULL</entry>
155994689c1Smrg    </row>
156994689c1Smrg    <row>
157994689c1Smrg      <entry>height</entry>
158994689c1Smrg      <entry>Height</entry>
159994689c1Smrg      <entry>Dimension</entry>
160994689c1Smrg      <entry></entry>
161994689c1Smrg      <entry>120</entry>
162994689c1Smrg    </row>
163994689c1Smrg    <row>
164994689c1Smrg      <entry>highlight</entry>
165994689c1Smrg      <entry>Foreground</entry>
166994689c1Smrg      <entry>Pixel</entry>
167994689c1Smrg      <entry></entry>
168994689c1Smrg      <entry>XtDefaultForeground</entry>
169994689c1Smrg    </row>
170994689c1Smrg    <row>
171994689c1Smrg      <entry>insensitiveBorder</entry>
172994689c1Smrg      <entry>Insensitive</entry>
173994689c1Smrg      <entry>Pixmap</entry>
174994689c1Smrg      <entry></entry>
175994689c1Smrg      <entry>GreyPixmap</entry>
176994689c1Smrg    </row>
177994689c1Smrg    <row>
178994689c1Smrg      <entry>international</entry>
179994689c1Smrg      <entry>International</entry>
180994689c1Smrg      <entry>Boolean</entry>
181994689c1Smrg      <entry>C</entry>
182994689c1Smrg      <entry>False</entry>
183994689c1Smrg    </row>
184994689c1Smrg    <row>
185994689c1Smrg      <entry>jumpScroll</entry>
186994689c1Smrg      <entry>JumpScroll</entry>
187994689c1Smrg      <entry>int</entry>
188994689c1Smrg      <entry>A</entry>
189994689c1Smrg      <entry>half the width of the widget</entry>
190994689c1Smrg    </row>
191994689c1Smrg    <row>
192994689c1Smrg      <entry>mappedWhenManaged</entry>
193994689c1Smrg      <entry>MappedWhenManaged</entry>
194994689c1Smrg      <entry>Boolean</entry>
195994689c1Smrg      <entry></entry>
196994689c1Smrg      <entry>True</entry>
197994689c1Smrg    </row>
198994689c1Smrg    <row>
199994689c1Smrg      <entry>minScale</entry>
200994689c1Smrg      <entry>Scale</entry>
201994689c1Smrg      <entry>int</entry>
202994689c1Smrg      <entry></entry>
203994689c1Smrg      <entry>1</entry>
204994689c1Smrg    </row>
205994689c1Smrg    <row>
206994689c1Smrg      <entry>pointerColor</entry>
207994689c1Smrg      <entry>Foreground</entry>
208994689c1Smrg      <entry>Pixel</entry>
209994689c1Smrg      <entry></entry>
210994689c1Smrg      <entry>XtDefaultForeground</entry>
211994689c1Smrg    </row>
212994689c1Smrg    <row>
213994689c1Smrg      <entry>pointerColorBackground</entry>
214994689c1Smrg      <entry>Background</entry>
215994689c1Smrg      <entry>Pixel</entry>
216994689c1Smrg      <entry></entry>
217994689c1Smrg      <entry>XtDefaultBackground</entry>
218994689c1Smrg    </row>
219994689c1Smrg    <row>
220994689c1Smrg      <entry>screen</entry>
221994689c1Smrg      <entry>Screen</entry>
222994689c1Smrg      <entry>Pointer</entry>
223994689c1Smrg      <entry>R</entry>
224994689c1Smrg      <entry>Parent's Screen</entry>
225994689c1Smrg    </row>
226994689c1Smrg    <row>
227994689c1Smrg      <entry>sensitive</entry>
228994689c1Smrg      <entry>Sensitive</entry>
229994689c1Smrg      <entry>Boolean</entry>
230994689c1Smrg      <entry></entry>
231994689c1Smrg      <entry>True</entry>
232994689c1Smrg    </row>
233994689c1Smrg    <row>
234994689c1Smrg      <entry>translations</entry>
235994689c1Smrg      <entry>Translations</entry>
236994689c1Smrg      <entry>TranslationTable</entry>
237994689c1Smrg      <entry></entry>
238994689c1Smrg      <entry>NULL</entry>
239994689c1Smrg    </row>
240994689c1Smrg    <row>
241994689c1Smrg      <entry>update</entry>
242994689c1Smrg      <entry>Interval</entry>
243994689c1Smrg      <entry>int</entry>
244994689c1Smrg      <entry></entry>
245994689c1Smrg      <entry>10</entry>
246994689c1Smrg    </row>
247994689c1Smrg    <row>
248994689c1Smrg      <entry>width</entry>
249994689c1Smrg      <entry>Width</entry>
250994689c1Smrg      <entry>Dimension</entry>
251994689c1Smrg      <entry></entry>
252994689c1Smrg      <entry>120</entry>
253994689c1Smrg    </row>
254994689c1Smrg    <row>
255994689c1Smrg      <entry>x</entry>
256994689c1Smrg      <entry>Position</entry>
257994689c1Smrg      <entry>Position</entry>
258994689c1Smrg      <entry></entry>
259994689c1Smrg      <entry>0</entry>
260994689c1Smrg    </row>
261994689c1Smrg    <row>
262994689c1Smrg      <entry>y</entry>
263994689c1Smrg      <entry>Position</entry>
264994689c1Smrg      <entry>Position</entry>
265994689c1Smrg      <entry></entry>
266994689c1Smrg      <entry>0</entry>
267994689c1Smrg    </row>
268994689c1Smrg  </tbody>
269994689c1Smrg  </tgroup>
270994689c1Smrg</informaltable>
271994689c1Smrg<!-- .Ac -->
272994689c1Smrg<!-- .As -->
273994689c1Smrg<!-- .Bg -->
274994689c1Smrg<!-- .Gp -->
275994689c1Smrg<!-- .Bc -->
276994689c1Smrg<!-- .Bp -->
277994689c1Smrg<!-- .Bw -->
278994689c1Smrg<!-- .Cm -->
279994689c1Smrg<!-- .Cu -->
280994689c1Smrg<!-- .Cn -->
281994689c1Smrg<!-- .Dp -->
282994689c1Smrg<!-- .Dc -->
283994689c1Smrg<variablelist>
284994689c1Smrg  <varlistentry>
285994689c1Smrg    <term>
286994689c1Smrg      <function>foreground</function>
287994689c1Smrg    </term>
288994689c1Smrg    <listitem>
289994689c1Smrg      <para>
290994689c1SmrgA pixel value which indexes the widget's colormap to derive the color
291994689c1Smrgthat will be used to draw the graph.
292994689c1Smrg      </para>
293994689c1Smrg    </listitem>
294994689c1Smrg  </varlistentry>
295994689c1Smrg  <varlistentry>
296994689c1Smrg    <term>
297994689c1Smrg      <function>getValue</function>
298994689c1Smrg    </term>
299994689c1Smrg    <listitem>
300994689c1Smrg      <para>
301994689c1SmrgA list of callback functions to call every <function>update</function> seconds.
302994689c1SmrgThis list should contain one function, which returns the
303994689c1Smrgvalue to be graphed by the StripChart widget.  The following
304994689c1Smrgsection describes the procedural interface.  Behavior when this list has
305994689c1Smrgmore than one function is undefined.
306994689c1Smrg<!-- .Hw -->
307994689c1Smrg      </para>
308994689c1Smrg    </listitem>
309994689c1Smrg  </varlistentry>
310994689c1Smrg  <varlistentry>
311994689c1Smrg    <term>
312994689c1Smrg      <function>highlight</function>
313994689c1Smrg    </term>
314994689c1Smrg    <listitem>
315994689c1Smrg      <para>
316994689c1SmrgA pixel value which indexes the widget's colormap to derive the color
317994689c1Smrgthat will be used to draw the scale lines on the graph.
318994689c1Smrg<!-- .Ib -->
319994689c1Smrg<!-- .Ix -->
320994689c1Smrg      </para>
321994689c1Smrg    </listitem>
322994689c1Smrg  </varlistentry>
323994689c1Smrg  <varlistentry>
324994689c1Smrg    <term>
325994689c1Smrg      <function>jumpScroll</function>
326994689c1Smrg    </term>
327994689c1Smrg    <listitem>
328994689c1Smrg      <para>
329994689c1SmrgWhen the graph reaches the right edge of the window it must be
330994689c1Smrgscrolled to the left.  This resource specifies the number of pixels
331994689c1Smrgit will jump.  Smooth scrolling can be achieved by setting this resource
332994689c1Smrgto 1.
333994689c1Smrg<!-- .Mm -->
334994689c1Smrg      </para>
335994689c1Smrg    </listitem>
336994689c1Smrg  </varlistentry>
337994689c1Smrg  <varlistentry>
338994689c1Smrg    <term>
339994689c1Smrg      <function>minScale</function>
340994689c1Smrg    </term>
341994689c1Smrg    <listitem>
342994689c1Smrg      <para>
343994689c1SmrgThe minimum scale for the graph.  The number of divisions on the graph
344994689c1Smrgwill always be greater than or equal to this value.
345994689c1Smrg<!-- .Pf -->
346994689c1Smrg<!-- .Pb -->
347994689c1Smrg<!-- .Sc -->
348994689c1Smrg<!-- .Se -->
349994689c1Smrg<!-- .Tr -->
350994689c1Smrg      </para>
351994689c1Smrg    </listitem>
352994689c1Smrg  </varlistentry>
353994689c1Smrg  <varlistentry>
354994689c1Smrg    <term>
355994689c1Smrg      <function>update</function>
356994689c1Smrg    </term>
357994689c1Smrg    <listitem>
358994689c1Smrg      <para>
359994689c1SmrgThe number of seconds between graph updates.  Each update is
360994689c1Smrgrepresented on the graph as a 1 pixel wide line.  Every <function>update</function> seconds
361994689c1Smrgthe <function>getValue</function> procedure will be used to get a new graph point,
362994689c1Smrgand this point will be added to the right end of the StripChart.
363994689c1Smrg<!-- .Xy -->
364994689c1Smrg    </para>
365994689c1Smrg  </listitem>
366994689c1Smrg  </varlistentry>
367994689c1Smrg</variablelist>
368994689c1Smrg</para>
369994689c1Smrg</sect2>
370994689c1Smrg<sect2 id="Getting_the_StripChart_Value">
371994689c1Smrg<title>Getting the StripChart Value</title>
3725ec34c4cSmrg<indexterm><primary>StripChart widget</primary><secondary>getting the value</secondary></indexterm>
373994689c1Smrg<para>
374994689c1Smrg<!-- .LP -->
375994689c1SmrgThe StripChart widget will call the application routine passed to it
376994689c1Smrgas the <function>getValue</function> callback function every <function>update</function> seconds to
377994689c1Smrgobtain another point for the StripChart graph.
378994689c1Smrg</para>
379994689c1Smrg<para>
380994689c1Smrg<!-- .LP -->
381994689c1SmrgThe calling interface for the <function>getValue</function> callback is:
3825ec34c4cSmrg<indexterm significance="preferred"><primary>StripChart widget</primary><secondary>getValue callback</secondary></indexterm>
383994689c1Smrg<funcsynopsis>
384994689c1Smrg<funcprototype>
385994689c1Smrg  <funcdef><function> void</function>(*getValueProc)</funcdef>
386994689c1Smrg  <paramdef>Widget<parameter> w</parameter></paramdef>
387994689c1Smrg  <paramdef>XtPointer<parameter> client_data</parameter></paramdef>
388994689c1Smrg  <paramdef>XtPointer<parameter> value</parameter></paramdef>
389994689c1Smrg</funcprototype>
390994689c1Smrg</funcsynopsis>
391994689c1Smrg<!-- .FN -->
392994689c1Smrg<variablelist>
393994689c1Smrg  <varlistentry>
394994689c1Smrg    <term>
395994689c1Smrg      <emphasis remap='I'>w</emphasis>
396994689c1Smrg    </term>
397994689c1Smrg    <listitem>
398994689c1Smrg      <para>
399994689c1SmrgSpecifies the StripChart widget.
400994689c1Smrg      </para>
401994689c1Smrg    </listitem>
402994689c1Smrg  </varlistentry>
403994689c1Smrg  <varlistentry>
404994689c1Smrg    <term>
405994689c1Smrg      <emphasis remap='I'>client_data</emphasis>
406994689c1Smrg    </term>
407994689c1Smrg    <listitem>
408994689c1Smrg      <para>
409994689c1SmrgSpecifies the client data.
410994689c1Smrg      </para>
411994689c1Smrg    </listitem>
412994689c1Smrg  </varlistentry>
413994689c1Smrg  <varlistentry>
414994689c1Smrg    <term>
415994689c1Smrg      <emphasis remap='I'>value</emphasis>
416994689c1Smrg    </term>
417994689c1Smrg    <listitem>
418994689c1Smrg      <para>
419994689c1SmrgReturns a pointer to a double.  The application should set the address
420994689c1Smrgpointed to by this argument to a double containing the value to be
421994689c1Smrggraphed on the StripChart.
422994689c1Smrg    </para>
423994689c1Smrg  </listitem>
424994689c1Smrg  </varlistentry>
425994689c1Smrg</variablelist>
426994689c1Smrg</para>
427994689c1Smrg<para>
428994689c1Smrg<!-- .LP -->
429994689c1SmrgThis function is used by the StripChart to call an application routine.
430994689c1SmrgThe routine will pass the value to be graphed back to the the StripChart
431994689c1Smrgin the <function>value</function> field of this routine.
432994689c1Smrg
433994689c1Smrg</para>
434994689c1Smrg</sect2>
435994689c1Smrg</sect1>
436