
The following code fragment produces a slider with a label:
xv_create(panel, PANEL_SLIDER,
PANEL_LABEL_STRING, "Brightness: ",
PANEL_VALUE, 75,
PANEL_MIN_VALUE, 0,
PANEL_MAX_VALUE, 100,
PANEL_SLIDER_WIDTH, 300,
PANEL_TICKS, 5,
PANEL_NOTIFY_PROC, brightness_proc,
NULL);
The output is shown in Figure 7-17.
Figure 7-17. Sample panel with slider item
7.14 Gauges
Gauges are just like sliders, but they are “output only” items. That is, you set the value of the
item and the display of the gauge changes just as it would for sliders. Also, there is no op-
tional type-in field and there is no drag box for the user to interactively change the value of
the gauge. The gauge is intended to be used only as a feedback item.
To create a gauge, use the PANEL_GAUGE package. To set a gauge’s width or height, use
PANEL_GAUGE_WIDTH. This attribute sets the length of the object, whether it is vertically or
horizontally oriented. As with the slider, the orientation is set by the attribute
PANEL_DIRECTION.
7.15 Text Items
A panel text item contains as its value a NULL-terminated string. It contains only printable
characters with no newlines. When a panel receives keyboard input (regardless of where the
pointer is as long as it is within the boundaries of the panel), the keyboard event is passed to
the item with the keyboard focus. A caret is used to indicate the insertion point where new
text is added. You can type in more text ...