[−][src]Function vgtk::start
pub fn start<C: 'static + Component>() -> (Application, Scope<C>)
Start an Application
component.
This will instantiate the component, construct the Application
object and register it as the default Application
. You will need
to call Application::run()
on this to actually start the
GTK event loop and activate the application.
Calling this instead of vgtk::run() is useful if you need to get your
component's Scope
in order to fire off some async work at startup and
notify it when the work is done.
If the component doesn't have an Application
as its top level
object, this function will panic.
Examples
let (app, scope) = vgtk::start::<MyComponent>(); let args: Vec<String> = std::env::args().collect(); std::process::exit(app.run(&args));