package lambda-term

  1. Overview
  2. Docs
Module type
Class type

Interface between an adjustment and a scrollbar widget.

inherit adjustment
method incr : int

Return offset incremented by one step

If range > number of scroll bar steps then step>=1.

method decr : int

Return offset decremented by one step

method mouse_scroll : int -> int

adj#mouse_scroll offset computes the scroll bar based on a click offset units from the top/left

method set_scroll_bar_mode : [ `fixed of int | `dynamic of int ] -> unit

Configure how the size of the scrollbar is calculated.

`fixed x sets the size to x.

`dynamic 0 sets the size to reflect the ratio between the range and scroll window size.

`dynamic x (x>0) interprets x as the viewable size and sets the size of the scroll bar to reflect the amount of content displayed relative to range.

method set_mouse_mode : [ `middle | `ratio | `auto ] -> unit

Configure how a mouse coordinate is converted to a scroll bar offest.

`middle sets the middle of the scrollbar to the position clicked.

`ratio computes the offset relative to the scroll bar and scroll window sizes, with a 10% deadzone at the extremities.

`auto chooses `middle mode if the scroll bar size is less than half the window size and `ratio otherwise.

method set_min_scroll_bar_size : int -> unit

Set the minimum scroll bar size (default:1)

method set_max_scroll_bar_size : int -> unit

Set the maximum scroll bar size (default: scroll window size

method on_scrollbar_change : ?switch:LTerm_widget_callbacks.switch -> (unit -> unit) -> unit

on_scrollbar_change ?switch f calls f when the scrollbar is changed and needs to be re-drawn.


Innovation. Community. Security.