Struct kas_widgets::ScrollBar [−][src]
pub struct ScrollBar<D: Directional> { /* fields omitted */ }
Expand description
A scroll bar
Scroll bars allow user-input of a value between 0 and a defined maximum, and allow the size of the handle to be specified.
Implementations
Construct a scroll bar with the given direction
Default values are assumed for all parameters.
Set the initial page length
Set the initial value
Set the page limits
The max_value
parameter specifies the maximum possible value.
(The minimum is always 0.) For a scroll region, this should correspond
to the maximum possible offset.
The handle_value
parameter specifies the size of the handle relative to
the maximum value: the handle size relative to the length of the scroll
bar is handle_value / (max_value + handle_value)
. For a scroll region,
this should correspond to the size of the visible region.
The minimum value is 1.
The choice of units is not important (e.g. can be pixels or lines), so long as both parameters use the same units.
Returns TkAction::REDRAW
if a redraw is required.
Read the current max value
See also the ScrollBar::set_limits
documentation.
Read the current handle value
See also the ScrollBar::set_limits
documentation.
Trait Implementations
Get the number of child widgets
Get a reference to a child widget by index, or None
if the index is
out of bounds. Read more
Mutable variant of get Read more
Record first identifier Read more
Check whether id
is a descendant Read more
Find the child which is an ancestor of this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Find the leaf (lowest descendant) with this id
, if any Read more
Walk through all widgets, calling f
once on each. Read more
Walk through all widgets, calling f
once on each. Read more
Get self as type Any
(mutable)
Get the name of the widget struct
Erase type
Erase type
Get whether the widget is disabled
Set the disabled state of a widget Read more
Set disabled state (chaining) Read more
Construct InputState
Read more
Auto Trait Implementations
impl<D> RefUnwindSafe for ScrollBar<D> where
D: RefUnwindSafe,
impl<D> UnwindSafe for ScrollBar<D> where
D: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more