Trait bones_framework::render::ui::EguiContextExt
source · pub trait EguiContextExt {
// Required methods
fn clear_focus(self);
fn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T;
fn set_state<T: Clone + Default + Sync + Send + 'static>(self, value: T);
}
Expand description
Extension trait with helpers for the egui context
Required Methods§
sourcefn clear_focus(self)
fn clear_focus(self)
Clear the UI focus
sourcefn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T
fn get_state<T: Clone + Default + Sync + Send + 'static>(self) -> T
Get a global runtime state from the EGUI context, returning the default value if it is not present.
This is just a convenience wrapper around Egui’s built in temporary data store.
The value will be cloned to get it out of the store without holding a lock.
Object Safety§
This trait is not object safe.