Skip to main content

EventCx

Struct EventCx 

Source
pub struct EventCx<'a, M> {
    pub rect: Rect,
    pub content: Rect,
    pub state: ElementState,
    pub style: &'a ComputedStyle,
    /* private fields */
}
Expand description

What a widget can do while handling an event.

Fields§

§rect: Rect

The element’s border box.

§content: Rect

The element’s content box.

§state: ElementState

The element’s state at the time of the event.

§style: &'a ComputedStyle

The element’s computed style.

Implementations§

Source§

impl<M> EventCx<'_, M>

Source

pub fn emit(&mut self, message: M)

Sends a message to the application.

Source

pub fn click(&mut self)

Fires the element’s click handler, if it has one.

Source

pub fn change(&mut self, text: String)

Source

pub fn toggle(&mut self, checked: bool)

Source

pub fn submit(&mut self, text: String)

Source

pub fn request_focus(&mut self)

Asks for keyboard focus to move to this element.

Source

pub fn mark_changed(&mut self)

Tells the framework the widget’s appearance or size changed, so styles and layout are recomputed before the next paint.

Source

pub fn fonts(&self) -> &dyn Fonts

For measuring text, for example to place a caret under the pointer.

Auto Trait Implementations§

§

impl<'a, M> !RefUnwindSafe for EventCx<'a, M>

§

impl<'a, M> !Send for EventCx<'a, M>

§

impl<'a, M> !Sync for EventCx<'a, M>

§

impl<'a, M> !UnwindSafe for EventCx<'a, M>

§

impl<'a, M> Freeze for EventCx<'a, M>

§

impl<'a, M> Unpin for EventCx<'a, M>

§

impl<'a, M> UnsafeUnpin for EventCx<'a, M>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.