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: KeyboardModifiers
Keyboard modifiers state.
window_title: String
The current title of the window
fullscreen: bool
Are 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 !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