pub struct Window {
    pub title: String,
    pub icon: Option<Image>,
    pub size: Size,
    pub sizing: WindowSizing,
    pub scale: f32,
    pub resizable: bool,
    pub decorated: bool,
    pub maximized: bool,
    pub visible: bool,
    pub color: Option<Color>,
    /* private fields */
}Expand description
A window.
Fields§
§title: StringThe title of the window.
icon: Option<Image>The icon of the window.
size: SizeThe size of the window.
sizing: WindowSizingThe sizing of the window.
scale: f32The scale of the window.
Modifying this is not recommended, and will probably not do what you expect, as a rule of thumb, don’t do it.
resizable: boolWhether the window is resizable.
decorated: boolWhether the window is decorated.
maximized: boolWhether the window is maximized.
visible: boolWhether the window is visible.
color: Option<Color>The color of the window.
Implementations§
Source§impl Window
 
impl Window
Sourcepub fn sizing(self, sizing: WindowSizing) -> Self
 
pub fn sizing(self, sizing: WindowSizing) -> Self
Set the sizing of the window.
Sourcepub fn fit_content(self) -> Self
 
pub fn fit_content(self) -> Self
Set the sizing to WindowSizing::Content.
Sourcepub fn physical_size(&self) -> Size
 
pub fn physical_size(&self) -> Size
Get the size of the window in physical pixels.
This is a shorthand for self.size * self.scale.
Sourcepub fn pointers_mut(&mut self) -> &mut Vec<Pointer>
 
pub fn pointers_mut(&mut self) -> &mut Vec<Pointer>
Get the pointers in the window mutably.
Sourcepub fn is_hovered(&self, view_id: ViewId) -> bool
 
pub fn is_hovered(&self, view_id: ViewId) -> bool
Get whether a specific view is hovered.
Sourcepub fn is_pointer_held(
    &self,
    pointer_id: PointerId,
    button: PointerButton,
) -> bool
 
pub fn is_pointer_held( &self, pointer_id: PointerId, button: PointerButton, ) -> bool
Get whether button is held down on pointer with pointer_id.
Sourcepub fn get_pointer(&self, pointer_id: PointerId) -> Option<&Pointer>
 
pub fn get_pointer(&self, pointer_id: PointerId) -> Option<&Pointer>
Get the pointer with pointer_id.
Sourcepub fn get_pointer_mut(&mut self, pointer_id: PointerId) -> Option<&mut Pointer>
 
pub fn get_pointer_mut(&mut self, pointer_id: PointerId) -> Option<&mut Pointer>
Get the pointer with pointer_id mutably.
Sourcepub fn press_pointer(&mut self, pointer_id: PointerId, button: PointerButton)
 
pub fn press_pointer(&mut self, pointer_id: PointerId, button: PointerButton)
Press a button on a pointer.
This is rarely what you want to do, do not use this unless you really know what you are doing.
Sourcepub fn release_pointer(
    &mut self,
    pointer_id: PointerId,
    button: PointerButton,
) -> bool
 
pub fn release_pointer( &mut self, pointer_id: PointerId, button: PointerButton, ) -> bool
Release a button on a pointer.
This is rarely what you want to do, do not use this unless you really know what you are doing.
Sourcepub fn move_pointer(&mut self, pointer_id: PointerId, position: Point) -> Vector
 
pub fn move_pointer(&mut self, pointer_id: PointerId, position: Point) -> Vector
Move a pointer, returning the movement.
Sourcepub fn remove_pointer(&mut self, pointer_id: PointerId)
 
pub fn remove_pointer(&mut self, pointer_id: PointerId)
Remove a pointer.
This is rarely what you want to do, do not use this unless you really know what you are doing.
Sourcepub fn updates(&mut self) -> Vec<WindowUpdate>
 
pub fn updates(&mut self) -> Vec<WindowUpdate>
Update the window.
Sourcepub fn snapshot(&self) -> WindowSnapshot
 
pub fn snapshot(&self) -> WindowSnapshot
Get the WindowSnapshot of the window.