fn remove_window(&mut self, window_id: WindowId) {
        self.with_delegate(|del, data, env, ctx| del.window_removed(window_id, data, env, ctx));
        // when closing the last window:
        if let Some(mut win) = self.windows.remove(window_id) {
            if self.windows.windows.is_empty() {
                // on mac we need to keep the menu around
                self.root_menu = win.menu.take();
                // If there are even no pending windows, we quit the run loop.
                if self.windows.count() == 0 {
                    #[cfg(any(target_os = "windows", feature = "x11"))]
                    self.app.quit();
                }
            }
        }

        // if we are closing the window that is currently responsible for
        // waking us when external events arrive, we want to pass that responsibility
        // to another window.
        if self.ext_event_host.handle_window_id == Some(window_id) {
            self.ext_event_host.handle_window_id = None;
            // find any other live window
            let win_id = self.windows.windows.keys().find(|k| *k != &window_id);
            if let Some(any_other_window) = win_id.cloned() {
                self.set_ext_event_idle_handler(any_other_window);
            }
        }
    }
/// Called after this window has been closed by the platform.
///
/// We clean up resources and notifiy the delegate, if necessary.
Called after this window has been closed by the platform.
We clean up resources and notifiy the delegate, if necessary.
Called after this window has been closed by the platform . We clean up resources and notifiy the delegate if necessary .
fn remove_window(&mut self, window_id: WindowId) {
        self.with_delegate(|del, data, env, ctx| del.window_removed(window_id, data, env, ctx));
        // when closing the last window:
        if let Some(mut win) = self.windows.remove(window_id) {
            if self.windows.windows.is_empty() {
                // on mac we need to keep the menu around
                self.root_menu = win.menu.take();
                // If there are even no pending windows, we quit the run loop.
                if self.windows.count() == 0 {
                    #[cfg(any(target_os = "windows", feature = "x11"))]
                    self.app.quit();
                }
            }
        }
        // if we are closing the window that is currently responsible for
        // waking us when external events arrive, we want to pass that responsibility
        // to another window.
        if self.ext_event_host.handle_window_id == Some(window_id) {
            self.ext_event_host.handle_window_id = None;
            // find any other live window
            let win_id = self.windows.windows.keys().find(|k| *k != &window_id);
            if let Some(any_other_window) = win_id.cloned() {
                self.set_ext_event_idle_handler(any_other_window);
            }
        }
    }
fn remove_window ( & mut self , window_id : WindowId ) { self . with_delegate ( | del , data , env , ctx | del . window_removed ( window_id , data , env , ctx ) ) ; // when closing the last window: if let Some ( mut win ) = self . windows . remove ( window_id ) { if self . windows . windows . is_empty ( ) { // on mac we need to keep the menu around self . root_menu = win . menu . take ( ) ; // If there are even no pending windows, we quit the run loop. if self . windows . count ( ) == 0 { # [ cfg ( any ( target_os " " feature " " ) ) ] self . app . quit ( ) ; } } } // if we are closing the window that is currently responsible for // waking us when external events arrive, we want to pass that responsibility // to another window. if self . ext_event_host . handle_window_id == Some ( window_id ) { self . ext_event_host . handle_window_id = None ; // find any other live window let win_id = self . windows . windows . keys ( ) . find ( | k | * k != & window_id ) ; if let Some ( any_other_window ) = win_id . cloned ( ) { self . set_ext_event_idle_handler ( any_other_window ) ; } } }
Called after this window has been closed by the platform.
Called after this window has been closed by the platform .
&mut self
window_id
WindowId
&mut self
window_id
WindowId