[][src]Struct nannou::ui::input::widget::Widget

pub struct Widget<'a> { /* fields omitted */ }

Provides only events and input state that are relevant to a specific widget.

This type can be produced by calling the UiCell::input method with the target widget's widget::Id. This is particularly useful

Unlike input::Global, input::Widget methods are tailored to the widget for which they are produced.

Implementations

impl<'a> Widget<'a>[src]

pub fn for_widget(
    idx: NodeIndex<u32>,
    rect: Rect,
    global: &'a Global
) -> Widget<'a>
[src]

Returns a Widget with events specifically for the given widget.

Filters out only the events that directly pertain to the widget.

All events will also be made relative to the widget's own (0, 0) origin.

pub fn mouse(&self) -> Option<Mouse<'a>>[src]

If the widget is currently capturing the mouse, this returns the state of the mouse.

Returns None if the widget is not capturing the mouse.

pub fn events(&self) -> Events<'a>

Notable traits for Events<'a>

impl<'a> Iterator for Events<'a> type Item = Widget;
[src]

Produces an iterator yielding all events that are relevant to a specific widget.

All events provided by this Iterator will be filtered in accordance with input capturing. For example: If the widget does not capture the mouse, it will not receive any mouse-related events. If the widget captures the keyboard it will receive all keyboard events.

All mouse events will have their coordinates relative to the middle of the widget's Rect.

pub fn presses(&self) -> Presses<'a>

Notable traits for Presses<'a>

impl<'a> Iterator for Presses<'a> type Item = Press;
[src]

Filters all events yielded by Self::events other than event::Presses.

pub fn releases(&self) -> Releases<'a>

Notable traits for Releases<'a>

impl<'a> Iterator for Releases<'a> type Item = Release;
[src]

Filters all events yielded by Self::events other than event::Releasees.

pub fn clicks(&self) -> Clicks<'a>

Notable traits for Clicks<'a>

impl<'a> Iterator for Clicks<'a> type Item = Click;
[src]

Filters all events yielded by Self::events for all event::Clicks.

A click is determined to have occured if a pointing device button was both pressed and released over the widget.

pub fn taps(&self) -> Taps<'a>

Notable traits for Taps<'a>

impl<'a> Iterator for Taps<'a> type Item = Tap;
[src]

Filters all events yielded by Self::events for all event::Taps.

A tap is determined to have occured if a touch interaction both started and ended over the widget.

pub fn drags(&self) -> Drags<'a>

Notable traits for Drags<'a>

impl<'a> Iterator for Drags<'a> type Item = Drag;
[src]

Produces an iterator that yields all event::Drag events yielded by the Events iterator.

Only events that occurred while the widget was capturing the device that did the dragging will be yielded.

pub fn texts(&self) -> Texts<'a>

Notable traits for Texts<'a>

impl<'a> Iterator for Texts<'a> type Item = Text;
[src]

Produces an iterator that yields all Input::Text events that have occurred as &strs since the last time Ui::set_widgets was called.

Only events that occurred while the widget was capturing the keyboard will be yielded.

pub fn scrolls(&self) -> Scrolls<'a>

Notable traits for Scrolls<'a>

impl<'a> Iterator for Scrolls<'a> type Item = Scroll;
[src]

Produce an iterator that yields only the Scroll events yielded by the Events iterator.

Trait Implementations

impl<'a> Clone for Widget<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Widget<'a>

impl<'a> Send for Widget<'a>

impl<'a> Sync for Widget<'a>

impl<'a> Unpin for Widget<'a>

impl<'a> UnwindSafe for Widget<'a>

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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

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

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

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> SetParameter for T

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

type Owned = T

The resulting type after obtaining ownership.

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<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<V, T> VZip<V> for T where
    V: MultiLane<T>,