slider%
Implements: control<%>
A slider object is a panel item with a handle that the user can
drag to change the control's value. Each slider has a fixed minimum
and maximum value.
Whenever the user changes the value of a slider, its callback procedure is invoked. A callback procedure is provided as an initialization argument when each slider is created.
( -> new slider% (label _) (min-value _) (max-value _) (parent _) (callback _) [(init-value _)] [(style _)] [(enabled _)] [(vert-margin _)] [(horiz-margin _)] [(min-width _)] [(min-height _)] [(stretchable-width _)] [(stretchable-height _)])slider% object
label : string (up to 200 characters) or #f
min-value : exact integer in [-10000, 10000]
max-value : exact integer in [-10000, 10000]
parent : frame%, dialog%, panel%, or pane% object
callback : procedure of two arguments: a slider% object and a control-event% object
init-value = : exact integer in [-10000, 10000]
min-value
style = : list of symbols in '(horizontal)'(horizontal vertical plain vertical-label horizontal-label deleted)
enabled = : boolean
#t
vert-margin = : exact integer in [0, 1000]
2
horiz-margin = : exact integer in [0, 1000]
2
min-width = : exact integer in [0, 10000]
0
min-height = : exact integer in [0, 10000]
0
stretchable-width = : boolean
#t for 'horizontal style, #f for 'vertical
stretchable-height = : boolean#t for 'vertical style, #f for 'horizontal
If label is a string, it is used as the label for the slider.
Otherwise, the slider does not display its
label.
If an ampersand (``&'') occurs in label, it
is specially parsed; under Windows and X, the character following an
ampersand is underlined in the displayed control to indicate a
keyboard mnemonic. (Under Mac OS, mnemonic underlines are not shown.)
The underlined mnemonic character must be a letter or a digit. The
user can move the keyboard focus to the slider by typing the mnemonic when the control's
top-level-window contains the keyboard focus. The user must also hold
down the Meta or Alt key if the keyboard focus is currently in a
control that handles normal alphanumeric input. The ampersand itself
is removed from label before it is displayed for the control; a
double-ampersand in label is converted to a single ampersand
(with no mnemonic underlining). Mnemonic keyboard events are handled
by on-traverse-char (but not under
Mac OS).
The min-value and max-value arguments specify the range of
the slider, inclusive. The init-value argument optionally
specifies the slider's initial value. If the sequence
[min-value, initial-value, maximum-value] is not
increasing, an exn:application:mismatch exception is raised.
The callback procedure is called (with the event type
'slider) when the user changes the slider's value.
The style argument must include either 'vertical for a
vertical slider, or 'horizontal for a horizontal slider. If
style includes 'plain, the slider does not display
numbers for its range and current value to the user.
If style includes 'vertical-label, then the gauge is
created with a label above the control; if style includes
'horzontal-label (and not 'vertical-label), then the
label is to the left of the gauge; otherwise, the label position is determined by
parent, as set through the
set-label-position method.
If style includes 'deleted, then the slider is created as hidden,
and it does not affect its parent's geometry; the slider can be made active later by calling
parent's add-child method.
For information about the
enabled
argument, see window<%>. For information about the
horiz-margin and vert-margin
arguments, see subarea<%>. For information about the
min-width, min-height, stretchable-width, and stretchable-height
arguments, see area<%>.
All Methods
accept-drop-files from window<%>
client->screen from window<%>
command from control<%>
enable from window<%>
focus from window<%>
get-client-size from window<%>
get-cursor from window<%>
get-graphical-min-size from area<%>
get-height from window<%>
get-label from window<%>
get-parent from area<%>
get-plain-label from window<%>
get-size from window<%>
get-top-level-window from area<%>
get-value from slider%
get-width from window<%>
get-x from window<%>
get-y from window<%>
has-focus? from window<%>
horiz-margin from subarea<%>
is-enabled? from window<%>
is-shown? from window<%>
min-height from area<%>
min-width from area<%>
on-drop-file from window<%>
on-focus from window<%>
on-move from window<%>
on-size from window<%>
on-subwindow-char from window<%>
on-subwindow-event from window<%>
on-superwindow-enable from window<%>
on-superwindow-show from window<%>
popup-menu from window<%>
refresh from window<%>
screen->client from window<%>
set-cursor from window<%>
set-label from window<%>
set-value from slider%
show from window<%>
stretchable-height from area<%>
stretchable-width from area<%>
vert-margin from subarea<%>