Next: Slider Attributes, Previous: Slider Interaction, Up: Slider Object [Contents][Index]

#### 17.1.4 Other Slider Routines

To change the value and bounds of a slider use the following routines

    void fl_set_slider_value(FL_OBJECT *obj, double val);
    void fl_set_slider_bounds(FL_OBJECT *obj, double min, double max);

By default, the minimum value for a slider is 0.0, the maximum is 1.0 and the value is 0.5. For vertical sliders the slider position for the minimum value is at the left, for horizontal sliders at the top of the slider. By setting `nin` to a larger value than `max` in a call of `fl_set_slider_bounds()` this can be reversed.

If in a call of `fl_set_slider_bounds()` the actual value of a slider isn’t within the range of the new bounds, its value gets adjusted to the nearest limit. When the requested new slider value in a call of `fl_set_slider_value()` is outside the range of bounds it gets adjusted to the nearest boundary value.

To obtain the current value or bounds of a slider use

    double fl_get_slider_value(FL_OBJECT *obj);
    void fl_get_slider_bounds(FL_OBJECT *obj, double *min, double *max);

Per default a slider only reacts to the left mouse button. But sometimes it can be useful to modify this. To set this call

    void fl_set_slider_mouse_buttons(FL_OBJECT *obj,
                                     int mbuttons);

`mbuttons` is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle and 4 for the right mouse button.

To determine which mouse buttons a slider reacts to use

    void fl_get_slider_mouse_buttons(FL_OBJECT *obj,
                                     unsigned int *mbuttons);

The value returned via `mbuttons` is the same value as would be used in `fl_set_slider_mouse_buttons()`.

Next: Slider Attributes, Previous: Slider Interaction, Up: Slider Object [Contents][Index]