Next: Other Scrollbar Routines, Previous: Scrollbar Types, Up: Scrollbar Object [Contents][Index]

#### 17.2.3 Scrollbar Interaction

Whenever the user changes the value of the scrollbar, the scrollbar’s callback is called (if one is associated with the scrollbar). The scrollbar position can be changed in several ways. The most simple one is to left-click on the knob of the scrollbar and move the know while the left mouse button is kept pressed down. Left-clicking beside the know will move the knob in large steps toward the current position of the mouse, clicking with the middle or right mouse button in smaller steps. Small shifts can also be obtained by clicking on one of the buttons at the side of the scrollbar or by using the scroll-wheel somehwere over the scrollbar.

You can control under which conditions the scrollbar gets returned to your application or its callback invoked. To change the default, call

    void fl_set_object_return(FL_OBJECT *obj, unsigned int when);

where the parameter `when` can be one of the following 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 scrollbar 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 whenever value changed or mouse button was released.

The default setting for `when` for a scrollbar object is `FL_RETURN_CHANGED` (unless during the build of XForms you set the configuration flag `--enable-bwc-bs-hack` in which case the default is `FL_RETURN_NONE` to keep backward compatibility with earlier releases of the library).

See demo program `objreturn.c` for an example use of this.

Next: Other Scrollbar Routines, Previous: Scrollbar Types, Up: Scrollbar Object [Contents][Index]