@@ -17,6 +17,9 @@ impl WindowHandle {
1717 Self { window_handle, phantom : PhantomData }
1818 }
1919
20+ /// Blocks the thread and runs an event loop until the window is closed.
21+ ///
22+ /// The window is shown automatically if it wasn't already.
2023 #[ inline]
2124 pub fn run_until_closed ( self ) -> Result < ( ) , Error > {
2225 self . window_handle . run_until_closed ( ) ?;
@@ -92,11 +95,31 @@ impl WindowHandle {
9295 self . window_handle . handle_main_thread_callback ( )
9396 }
9497
98+ /// Reparents this window using the given `parent`.
99+ ///
100+ /// If the window was a floating window, it will become parented.
95101 #[ inline]
96102 pub fn set_parent ( & self , parent : impl Into < ParentWindowHandle > ) -> Result < ( ) , Error > {
97103 self . window_handle . set_parent ( parent. into ( ) . inner ) ?;
98104 Ok ( ( ) )
99105 }
106+
107+ /// Shows the window to the screen.
108+ #[ inline]
109+ pub fn show ( & self ) -> Result < ( ) , Error > {
110+ self . window_handle . show ( ) ?;
111+ Ok ( ( ) )
112+ }
113+
114+ /// Hides the window from the screen.
115+ ///
116+ /// The window will still exist, and it might still receive some events, but rendering will be
117+ /// paused and the user will not be able to see or interact with it.
118+ #[ inline]
119+ pub fn hide ( & self ) -> Result < ( ) , Error > {
120+ self . window_handle . hide ( ) ?;
121+ Ok ( ( ) )
122+ }
100123}
101124
102125#[ inline]
0 commit comments