mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 05:40:04 -04:00
Add visibility-related functions to window
This commit is contained in:
@@ -68,8 +68,8 @@ pub struct Window {
|
||||
impl Window {
|
||||
/// See the docs in the crate root file.
|
||||
pub fn new(builder: WindowBuilder) -> Result<Window, String> {
|
||||
let WindowBuilder { dimensions, title, monitor, gl_version, vsync } = builder;
|
||||
init::new_window(dimensions, title, monitor, gl_version, vsync, false)
|
||||
let WindowBuilder { dimensions, title, monitor, gl_version, vsync, visible } = builder;
|
||||
init::new_window(dimensions, title, monitor, gl_version, vsync, !visible)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,18 @@ impl Window {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn show(&self) {
|
||||
unsafe {
|
||||
ffi::ShowWindow(self.window, ffi::SW_SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn hide(&self) {
|
||||
unsafe {
|
||||
ffi::ShowWindow(self.window, ffi::SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
||||
/// See the docs in the crate root file.
|
||||
pub fn get_position(&self) -> Option<(int, int)> {
|
||||
use std::mem;
|
||||
|
||||
Reference in New Issue
Block a user