[][src]Struct kas::widget::ScrollRegion

pub struct ScrollRegion<W: Widget> { /* fields omitted */ }

A scrollable region

This region supports scrolling via mouse wheel and drag. Optionally, it can have scroll bars (see ScrollRegion::show_bars and ScrollRegion::with_bars).

Scroll regions translate their contents by an offset, which has a minimum value of Coord::ZERO and a maximum value of ScrollRegion::max_offset.

Methods

impl<W: Widget> ScrollRegion<W>[src]

pub fn new(inner: W) -> Self[src]

Construct a new scroll region around an inner widget

pub fn with_auto_bars(self, enable: bool) -> Self[src]

Auto-enable bars

If enabled, this automatically enables/disables scroll bars when resized.

This has the side-effect of reserving enough space for scroll bars even when not required.

pub fn with_bars(self, horiz: bool, vert: bool) -> Self[src]

Set which scroll bars are visible

pub fn show_bars(&mut self, horiz: bool, vert: bool)[src]

Set which scroll bars are visible

pub fn inner(&self) -> &W[src]

Access inner widget directly

pub fn inner_mut(&mut self) -> &mut W[src]

Access inner widget directly

pub fn max_offset(&self) -> Coord[src]

Get the maximum offset

pub fn offset(&self) -> Coord[src]

Get the current offset

pub fn set_offset(&mut self, offset: Coord) -> TkAction[src]

Set the scroll offset

Returns TkAction::None if the offset is identical to the old offset, or a greater action if not identical.

Trait Implementations

impl<W: Clone + Widget> Clone for ScrollRegion<W>[src]

impl<W: Debug + Widget> Debug for ScrollRegion<W>[src]

impl<W: Default + Widget> Default for ScrollRegion<W>[src]

impl<W: Widget> Handler for ScrollRegion<W>[src]

type Msg = <W as Handler>::Msg

Type of message returned by this widget Read more

impl<W: Widget> Layout for ScrollRegion<W>[src]

impl<W: Widget> SendEvent for ScrollRegion<W>[src]

impl<W: Widget> Widget for ScrollRegion<W>[src]

impl<W: Widget> WidgetChildren for ScrollRegion<W>[src]

impl<W: Widget> WidgetConfig for ScrollRegion<W>[src]

impl<W: Widget> WidgetCore for ScrollRegion<W>[src]

Auto Trait Implementations

impl<W> RefUnwindSafe for ScrollRegion<W> where
    W: RefUnwindSafe

impl<W> Send for ScrollRegion<W> where
    W: Send

impl<W> Sync for ScrollRegion<W> where
    W: Sync

impl<W> Unpin for ScrollRegion<W> where
    W: Unpin

impl<W> UnwindSafe for ScrollRegion<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme
[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme
[src]

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Dst> ConvAsUtil<Dst> for T[src]

impl<T> ConvUtil for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<Src> TryFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 
[src]

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Src> ValueFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 
[src]

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.