pub fn launch(mut self, data: T) -> Result<(), PlatformError> {
        let app = Application::new()?;

        let mut env = self
            .l10n_resources
            .map(|it| Env::with_i10n(it.0, &it.1))
            .unwrap_or_else(Env::with_default_i10n);

        if let Some(f) = self.env_setup.take() {
            f(&mut env, &data);
        }

        let mut state = AppState::new(
            app.clone(),
            data,
            env,
            self.delegate.take(),
            self.ext_event_host,
        );

        for desc in self.windows {
            let window = desc.build_native(&mut state)?;
            window.show();
        }

        let handler = AppHandler::new(state);
        app.run(Some(Box::new(handler)));
        Ok(())
    }
/// Build the windows and start the runloop.
///
/// Returns an error if a window cannot be instantiated. This is usually
/// a fatal error.
Build the windows and start the runloop.
Returns an error if a window cannot be instantiated. This is usually
a fatal error.
Build the windows and start the runloop . Returns an error if a window cannot be instantiated . This is usually a fatal error .
pub fn launch(mut self, data: T) -> Result<(), PlatformError> {
        let app = Application::new()?;
        let mut env = self
            .l10n_resources
            .map(|it| Env::with_i10n(it.0, &it.1))
            .unwrap_or_else(Env::with_default_i10n);
        if let Some(f) = self.env_setup.take() {
            f(&mut env, &data);
        }
        let mut state = AppState::new(
            app.clone(),
            data,
            env,
            self.delegate.take(),
            self.ext_event_host,
        );
        for desc in self.windows {
            let window = desc.build_native(&mut state)?;
            window.show();
        }
        let handler = AppHandler::new(state);
        app.run(Some(Box::new(handler)));
        Ok(())
    }
pub fn launch ( mut self , data : T ) -> Result < ( ) , PlatformError > { let app = Application :: new ( ) ? ; let mut env = self . l10n_resources . map ( | it | Env :: with_i10n ( it . 0 , & it . 1 ) ) . unwrap_or_else ( Env :: with_default_i10n ) ; if let Some ( f ) = self . env_setup . take ( ) { f ( & mut env , & data ) ; } let mut state = AppState :: new ( app . clone ( ) , data , env , self . delegate . take ( ) , self . ext_event_host , ) ; for desc in self . windows { let window = desc . build_native ( & mut state ) ? ; window . show ( ) ; } let handler = AppHandler :: new ( state ) ; app . run ( Some ( Box :: new ( handler ) ) ) ; Ok ( ( ) ) }
Build the windows and start the runloop.
Build the windows and start the runloop .
mut self
data
T
mut self
data
T