pub struct Window<'a> { /* private fields */ }Implementations§
Source§impl<'a> Window<'a>
impl<'a> Window<'a>
pub fn open_parented<P, H, B>(
parent: &P,
options: WindowOpenOptions,
build: B,
) -> WindowHandlewhere
P: HasRawWindowHandle,
H: WindowHandler + 'static,
B: FnOnce(&mut Window<'_>) -> H + Send + 'static,
pub fn open_blocking<H, B>(options: WindowOpenOptions, build: B)
Sourcepub fn resize(&mut self, size: Size)
pub fn resize(&mut self, size: Size)
Resize the window to the given size. The size is always in logical pixels. DPI scaling will automatically be accounted for.
Sourcepub fn set_scale_factor(&mut self, scale: f64)
pub fn set_scale_factor(&mut self, scale: f64)
Re-interpret the window at a new content-scale factor, holding the logical size constant and growing/shrinking the physical size to match.
This is for embedded plug-in views whose scale becomes known only after
the window is attached (the WindowScalePolicy chosen at open is
otherwise fixed for the window’s lifetime). Implemented on X11, where a
host may report its content scale late via
IPlugViewContentScaleSupport; a no-op on Windows and macOS, which
drive DPI through the OS. The change is applied on the next event-loop
iteration and reported to the handler via a Resized event.
pub fn set_mouse_cursor(&mut self, cursor: MouseCursor)
pub fn has_focus(&mut self) -> bool
pub fn focus(&mut self)
Sourcepub fn gl_context(&self) -> Option<&GlContext>
pub fn gl_context(&self) -> Option<&GlContext>
If provided, then an OpenGL context will be created for this window. You’ll be able to access this context through crate::Window::gl_context.