Construct the widget.
Returns a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in thumb position. For example, if the scrollbar is horizontal, the result indicates how much the scrollbar setting must change to move the thumb deltaX pixels to the right (deltaY is ignored in this case). If the scrollbar is vertical, the result indicates how much the scrollbar setting must change to move the thumb deltaY pixels down. The arguments and the result may be zero or negative.
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.
Set the widget's state.
Get the widget's state.
Test if a widget is in a particular state.
Remove the widget's state.
Reset the widget's state to default.
Set the widget's style.
Get the widget's style.
Set if the widget can recieve focus during keyboard traversal.
Get if the widget can recieve focus during keyboard traversal.
Geometry method for loosely placing this widget inside its parent using a web browser model. Widgets flow around each other in the available space.
Geometry method for placing this widget inside its parent using an imaginary grid. Somewhat more direct and intuitive than pack. Choose grid for tabular layouts, and when there's no good reason to choose something else.
Geometry method for placing this widget inside its parent using absolute positioning.
Geometry method for placing this widget inside its parent using relative positioning. In this case the position and size is specified as a floating-point number between 0.0 and 1.0 relative to the height of the parent. 0.5 means the widget will be half as high as the parent and 1.0 means the widget will have the same height as the parent, and so on.
auto frame = new Frame() .grid(0, 0); auto canvas = new Canvas(frame); .setWidth(300) .setHeight(150) .setScrollRegion(-100, -150, 500, 350) auto yscroll = new YScrollBar(frame) .attachWidget(canvas) .grid(1, 0, 0, 0, 1, 1, "nes"); auto xscroll = new XScrollBar(frame) .attachWidget(canvas) .grid(0, 1, 0, 0, 1, 1, "esw"); canvas.attachXScrollBar(xscroll) .attachYScrollBar(yscroll) .grid(0, 0, 0, 0, 1, 1, "nesw");
Additional events that can also be bound to using the bind method.
<<PrevWindow>>, <Alt-Key>, <B1-Motion>, <B2-Motion>, <Button-1>, <Button-2>, <ButtonRelease-1>, <ButtonRelease-2>, <Key-F10>, <Key-Tab>,
States: The scrollbar automatically sets the disabled state when the entire range is visible and clears it otherwise.
Scrollbar widgets are typically linked to an associated window that displays a document of some sort, such as a file being edited or a drawing. A scrollbar displays a thumb in the middle portion of the scrollbar, whose position and size provides information about the portion of the document visible in the associated window. The thumb may be dragged by the user to control the visible region. Depending on the theme, two or more arrow buttons may also be present; these are used to scroll the visible region in discrete units.