Struct appit::RunningWindow
source · pub struct RunningWindow<AppMessage>where
AppMessage: Message,{ /* private fields */ }
Expand description
A window that is running in its own thread.
Implementations§
source§impl<AppMessage> RunningWindow<AppMessage>where
AppMessage: Message,
impl<AppMessage> RunningWindow<AppMessage>where
AppMessage: Message,
sourcepub const fn next_redraw_target(&self) -> Option<RedrawTarget>
pub const fn next_redraw_target(&self) -> Option<RedrawTarget>
Returns the target for when the window will be redrawn.
sourcepub fn set_needs_redraw(&mut self)
pub fn set_needs_redraw(&mut self)
Sets the window to redraw as soon as it can.
sourcepub fn redraw_at(&mut self, instant: Instant)
pub fn redraw_at(&mut self, instant: Instant)
Sets the window to redraw at the provided time.
If the window is already set to redraw sooner, this function does nothing.
sourcepub fn redraw_in(&mut self, duration: Duration)
pub fn redraw_in(&mut self, duration: Duration)
Sets the window to redraw after a duration
.
If the window is already set to redraw sooner, this function does nothing.
sourcepub fn set_min_inner_size(&self, min_size: Option<PhysicalSize<u32>>)
pub fn set_min_inner_size(&self, min_size: Option<PhysicalSize<u32>>)
Sets the window’s minimum inner size.
sourcepub fn set_max_inner_size(&self, max_size: Option<PhysicalSize<u32>>)
pub fn set_max_inner_size(&self, max_size: Option<PhysicalSize<u32>>)
Sets the window’s maximum inner size.
sourcepub const fn inner_size(&self) -> PhysicalSize<u32>
pub const fn inner_size(&self) -> PhysicalSize<u32>
Returns the current size of the interior of the window, in pixels.
sourcepub fn set_inner_size(&self, new_size: PhysicalSize<u32>)
pub fn set_inner_size(&self, new_size: PhysicalSize<u32>)
Sets the inner size of the window, in pixels.
sourcepub const fn position(&self) -> PhysicalPosition<i32>
pub const fn position(&self) -> PhysicalPosition<i32>
Returns the current locpositionation of the window, in pixels.
sourcepub fn set_position(&self, new_position: PhysicalPosition<i32>)
pub fn set_position(&self, new_position: PhysicalPosition<i32>)
Sets the current position of the window, in pixels.
sourcepub const fn cursor_position(&self) -> Option<PhysicalPosition<f64>>
pub const fn cursor_position(&self) -> Option<PhysicalPosition<f64>>
Returns the position of the cursor relative to the window’s upper-left corner, in pixels.
sourcepub const fn occluded(&self) -> bool
pub const fn occluded(&self) -> bool
Returns true if the window is currently invisible, hidden behind other windows, minimized, or otherwise hidden from the user’s view.
sourcepub const fn focused(&self) -> bool
pub const fn focused(&self) -> bool
Returns true if the window is currently focused for keyboard input.
sourcepub const fn modifiers(&self) -> Modifiers
pub const fn modifiers(&self) -> Modifiers
Returns the current state of the keyboard modifier keys.
sourcepub fn pressed_keys(&self) -> impl Iterator<Item = PhysicalKey> + '_
pub fn pressed_keys(&self) -> impl Iterator<Item = PhysicalKey> + '_
Returns an iterator of the currently pressed keys.
This iterator does not guarantee any specific order.
sourcepub fn key_pressed(&self, key: &PhysicalKey) -> bool
pub fn key_pressed(&self, key: &PhysicalKey) -> bool
Returns true if the given key code is currently pressed.
Returns an iterator of the currently pressed mouse buttons.
This iterator does not guarantee any specific order.
Returns true if the button is currently pressed.