pub struct EventCx<'a> { /* private fields */ }
Expand description
A bundle of helper methods to be used by View::event
handlers
Implementations§
source§impl<'a> EventCx<'a>
impl<'a> EventCx<'a>
sourcepub fn request_all(&mut self, id: Id)
pub fn request_all(&mut self, id: Id)
request that this node be styled, laid out and painted again This will recursively request this for all parents.
sourcepub fn request_style(&mut self, id: Id)
pub fn request_style(&mut self, id: Id)
request that this node be styled again This will recursively request style for all parents.
sourcepub fn request_layout(&mut self, id: Id)
pub fn request_layout(&mut self, id: Id)
request that this node be laid out again
This will recursively request layout for all parents and set the ChangeFlag::LAYOUT
at root
sourcepub fn request_paint(&mut self, id: Id)
pub fn request_paint(&mut self, id: Id)
request that this node be painted again
pub fn app_state_mut(&mut self) -> &mut AppState
pub fn app_state(&self) -> &AppState
pub fn update_active(&mut self, id: Id)
pub fn is_active(&self, id: Id) -> bool
pub fn get_computed_style(&self, id: Id) -> Option<&Style>
pub fn get_layout(&self, id: Id) -> Option<Layout>
sourcepub fn view_event(
&mut self,
view: &mut dyn View,
id_path: Option<&[Id]>,
event: Event
) -> EventPropagation
pub fn view_event( &mut self, view: &mut dyn View, id_path: Option<&[Id]>, event: Event ) -> EventPropagation
Internal method used by Floem. This can be called from parent View
s to propagate an event to the child View
.
sourcepub fn should_send(&mut self, id: Id, event: &Event) -> bool
pub fn should_send(&mut self, id: Id, event: &Event) -> bool
Used to determine if you should send an event to another view. This is basically a check for pointer events to see if the pointer is inside a child view and to make sure the current view isn’t hidden or disabled. Usually this is used if you want to propagate an event to a child view