{<name>:} slider <start>,<finish> {,<value>}
Slider sub-panel. A horizontal or vertical bar with an internal button which can be interactively moved by the mouse to change a numeric value within a given range. The current value is displayed as the value changes.
Panel window
Tab window
Table window
<name>
A name to be given to the sub-panel for reference purposes.
<start>
The value corresponding to the left or top of the slider. This is a numeric value.
<finish>
The value corresponding to the right or bottom of the slider. This is a numeric value.
<value>
The initial slider value. This should be between <start>
and <finish>.
The default is<start>.
-dim=<screen_xy>
Define the dimensions of the slider in pixels. This is usually redundant
because sliders are by default created sized-to-fit, but is useful when
the size needs to be overridden. This is a two-element numeric array providing
width and height. If only one is required, the other can be set to -1 and
will be ignored.
-dp=<num>
The number of decimal places to print when displaying and computing slider values.
The default is 0.
-eb
Extend the height of the slider to the bottom of its parent row or column.
-er
Extend the width of the slider to the right of its parent row or column.
-fo=<font>
The font to be used for the text display of the slider value. This must
be a fixed font. If omitted the slider inherits the font of its parent row
or column.
-gh
The sub-panel should be initially ghosted, i.e. insensitive to user-interaction.
-h=<num>
The height of the slider trough in pixels. The default for vertical sliders is 100
pixels. For horizontal sliders, a suitable default is used.
-inv
Make the sub-panel invisible on creation.
-j=<just>
The justification of the slider within its parent row or column. Within a parent row the
value should be one of L, M, R. Within a parent column the value should
be one of T, M or B. The default in both cases is M.
-link=<text>
The resize linkage for the panel. This ties panel edges to one or more edges of the parent
window, with the result that when the parent window gets resized, the
panel gets automatically resized as well. <text>
is a combination of the characters L, R, T, B and M. A value of "LRTB"
means that the left, right, top and bottom edges of a sub-panel are linked
to its parent. The default value is "TL", which links the left
and top edges to the parent window but does no resizing because its right
and bottom edges are not linked. Note that the linkage is to edges of
the parent window, not to column/row extremities. More complicated linkage
requirements should be done via the window.resize
callback on the parent window.
-out
Output only. The presence of this switch will prevent the value of the
slider being changed interactively.
-pj=<just>
The position justification of the sub-panel within the panel window. This combined
with the -x and -y switches can be used to position
the sub-panel by one of its corners. The default is ’TL’. It also defines
the control point to be used when repositioning the sub-panel after creation.
-show
Show the current value of the slider in label form alongside the trough.
This is the default behavior. Use -no_show to
suppress.
-tc=<color>
The color for text when displaying the slider value. If omitted the parent
window "other color" is used.
-v
The slider is a vertical slider. The default is horizontal.
-w=<num>
The width of the slider trough in pixels. The default for horizontal sliders is
100 pixels. For vertical sliders, a suitable default is used.
-x=<num>
The x position of the slider relative to the top-left corner of its parent row
or column. If omitted, the slider is placed adjacent to the previously
defined sub-panel.
-y=<num>
The y position of the slider relative to the top-left corner of its parent row
or column. If omitted, the slider is placed below the previously defined
sub-panel.
Called while the slider is being dragged with mouse button 1 down.
<panel>.drag(<window>,<panel>{,<row>})
Panel/Tab Window
panel.drag { args w=window, p=panel }
Table Window
panel.drag { args w=window, p=panel, row=numeric }
Called when mouse button 1 is released.
<panel>.exec(<window>,<panel>{,<row>})
Panel/Tab Window
panel.exec { args w=window, p=panel }
Table Window
panel.exec { args w=window, p=panel, row=numeric }
Switches -j, -pj, -x and -y apply only to sliders within a panel window. Sliders within other windows and menupanes cannot have a user-defined position or justification.
Create a panel window containing a row of two horizontal sliders both of default size.
window w = wpanel { row { s1: slider 0,100,10,-tc=red s2: slider 10,0,1,-dp=2 } }
Create a panel window containing a vertical read-only slider of specified length.
window w = wpanel { s: slider 500,1000,-out,-fo=big_xfont,-h=300,-v }