Struct carbide_core::event_handler::EventHandler[][src]

pub struct EventHandler { /* fields omitted */ }

A basic, non-interactive rectangle shape widget.

Implementations

impl EventHandler[src]

pub fn get_events(&self) -> &Vec<WidgetEvent>[src]

pub fn clear_events(&mut self)[src]

impl EventHandler[src]

pub fn new() -> Self[src]

pub fn handle_event(
    &mut self,
    event: Input,
    window_dimensions: Dimensions
) -> Option<WindowEvent>
[src]

Handle raw window events and update the Ui state accordingly.

This occurs within several stages:

  1. Convert the user's given event to a RawEvent so that the Ui may use it.
  2. Interpret the RawEvent for higher-level Events such as DoubleClick, WidgetCapturesKeyboard, etc.
  3. Update the Ui's global_input State accordingly, depending on the RawEvent.
  4. Store newly produced event::Uis within the global_input so that they may be filtered and fed to Widgets next time Ui::set_widget is called.

This method drives the Ui forward, and is what allows for using carbide's Ui with any window event stream.

The given event must implement the ToRawEvent trait so that it can be converted to a RawEvent that can be used by the Ui.

Trait Implementations

impl Debug for EventHandler[src]

Auto Trait Implementations

Blanket Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

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

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>,