A pane with a sliding marker, which allows the user to control a numerical value within a specified range.
A function of two arguments, or a format string.
A generalized boolean.
An integer, a ratio or the keyword
slider allows the user to enter a number by moving a marker on a sliding scale to the desired value.
determines whether the slider displays the current value, on Microsoft Windows and GTK+. The default value is
is ignored on Cocoa.
specifies which end of the slider is the start point in the range. The values allowed depend on the
of the slider. For horizontal sliders,
can take these values:
The start point is on the left.
The start point is on the right.
The start point is at the default side (the left).
For vertical sliders,
can take these values:
The start point is at the top.
The start point is at the bottom.
The start point is at the default position, which is the top on Microsoft Windows and Motif, and the bottom on Cocoa.
specifies the spacing of tick marks drawn on the slider. If
:default, then the slider may or may not draw tick marks according the OS conventions. If
is 0, then no tick marks are drawn. If
is a ratio 1/N for integer N>1, then tick marks are drawn to divide the slider range into N sections. Otherwise
should be an integer greater than 1 which specifies the spacing of tick marks in units between
. The default value of
, when supplied, should be a function with signature
is the slider pane,
is its current value, and
is a string or
nil. When the slider pane displays the current value, it calls
and displays the value as
, unless that is
nil, in which case the value is printed normally.
As a special case,
can also be a string, which is used as the format string in a call to
format with one additional argument, the value, that is
and the result of this call to
format is displayed.
:print-function is not implemented on Motif.
:print-function has no effect on Cocoa because the slider pane never displays the value
Use of the
is determined when the slider pane is displayed. Setting the
in a slider that did not have a
when it was first displayed does not work until the slider is destroyed and displayed again. Therefore, if you want to display a
slider without a
but set it later, initially you should supply a
that always returns
nil, for example:
:start 10 :end 34
is useful for displaying fractional values or values that grow logarithmically (or any other non-linear function), because the actual values in a
slider are always integers that increase linearly as the slider moves.
On Windows the
slider's value is displayed (when
is true) in a tooltip that is visible only while the user moves the marker with a mouse.
In LispWorks 6.0 and earlier versions, ticks are drawn as if
Given the default
of 0 and 100, this gives ticks at 0, 25, 50, 75 and 100:
(make-instance 'slider :tick-frequency 25)
while this gives ticks at 0, 20, 40, 60, 80 and 100:
(make-instance 'slider :tick-frequency 1/5)
This example illustrates the use of
to display fractional and non-linear values ranges:
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017