ScrollBar.getFraction

Returns a real number between 0 and 1 indicating where the point given by x and y lies in the trough area of the scrollbar, where 0.0 corresponds to the top or left of the trough and 1.0 corresponds to the bottom or right. X and y are pixel coordinates relative to the scrollbar widget. If x and y refer to a point outside the trough, the closest point in the trough is used.

class ScrollBar
double
getFraction
(
int x
,
int y
)

Parameters

x int

The x position.

y int

The y position.

Return Value

Type: double

The fractional position.

Meta