Next: Other Slider Routines, Previous: Slider Types, Up: Slider Object [Contents][Index]
Whenever the user changes the value of the slider using the mouse, the
slider is returned (unless there’s callback function associated with
the object) by the interaction routines. The slider position is
changed by moving the mouse inside the slider area. For fine control,
hold down the <Shift>
key while usinf the slider, in that case
the slider doesn’t follow the mouse directly but at a lower speed.
Please note: the FL_VERT_PROGRESS_BAR
and
FL_HOR_PROGRESS_BAR
aren’t actually valuator objects
(they don’t react to any user interaction) but are vor visualization
only (i.e., showing a progress bar that is changed by the program
only), they appear here because they are directly derived from the
FL_VERT_FILL_SLIDER
and FL_VERT_FILL_SLIDER
slider. Thus the only way to change the value of objects of these
types is by calling fl_set_slider_value()
! To obtain the
correct "progress bar" behaviour you should also update the label
accordingly.
In some cases you might not want the slider to be returned or its callback called each time its value changes. To change the default, call the following routine:
void fl_set_object_return(FL_OBJECT *obj, unsigned int when)
where the parameter when
can be one of the four values:
FL_RETURN_NONE
Never return or invoke callback.
FL_RETURN_END_CHANGED
Return or invoke callback at end (mouse release) if value is changed since last return.
FL_RETURN_CHANGED
Return or invoke callback whenever the slider value is changed. This is the default.
FL_RETURN_END
Return or invoke callback at end (mouse release) regardless if the value is changed or not.
FL_RETURN_ALWAYS
Return or invoke callback when the value changed or at end (mouse release).
See the demo program objreturn.c for an example use of this.
Next: Other Slider Routines, Previous: Slider Types, Up: Slider Object [Contents][Index]