pub struct Context {
pub key_mods: KeyboardModifiers,
pub window_title: String,
pub fullscreen: bool,
/* private fields */
}Expand description
The Context stores all UI state. A user of the library shouldn’t have to interact with it directly.
Fields§
§key_mods: KeyboardModifiersKeyboard modifiers state.
window_title: StringThe current title of the window
fullscreen: boolAre we fullscreen?
Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
Sourcepub fn update(
&mut self,
view: &impl View,
vger: &mut Vger,
access_nodes: &mut Vec<(NodeId, Node)>,
window_size: Size2D<f32, WorldSpace>,
) -> bool
pub fn update( &mut self, view: &impl View, vger: &mut Vger, access_nodes: &mut Vec<(NodeId, Node)>, window_size: Size2D<f32, WorldSpace>, ) -> bool
Call this after the event queue is cleared.
Sourcepub fn render(
&mut self,
render_info: RenderInfo<'_>,
view: &impl View,
vger: &mut Vger,
window_size: Size2D<f32, WorldSpace>,
scale: f32,
)
pub fn render( &mut self, render_info: RenderInfo<'_>, view: &impl View, vger: &mut Vger, window_size: Size2D<f32, WorldSpace>, scale: f32, )
Redraw the UI using wgpu.
Sourcepub fn commands(&mut self, view: &impl View, cmds: &mut Vec<CommandInfo>)
pub fn commands(&mut self, view: &impl View, cmds: &mut Vec<CommandInfo>)
Get menu commands.
pub fn get<S>(&self, id: StateHandle<S>) -> &Swhere
S: 'static,
pub fn get_mut<S>(&mut self, id: StateHandle<S>) -> &mut Swhere
S: 'static,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more