Struct titanium::desktop::gui::libdruid::AppLauncher
pub struct AppLauncher<T> { /* private fields */ }
Expand description
Handles initial setup of an application, and starts the runloop.
Implementations§
§impl<T> AppLauncher<T>where
T: Data,
impl<T> AppLauncher<T>where T: Data,
pub fn with_window(window: WindowDesc<T>) -> AppLauncher<T>
pub fn with_window(window: WindowDesc<T>) -> AppLauncher<T>
Create a new AppLauncher
with the provided window.
pub fn configure_env(self, f: impl Fn(&mut Env, &T) + 'static) -> AppLauncher<T>
pub fn configure_env(self, f: impl Fn(&mut Env, &T) + 'static) -> AppLauncher<T>
Provide an optional closure that will be given mutable access to the environment and immutable access to the app state before launch.
This can be used to set or override theme values.
pub fn delegate(self, delegate: impl AppDelegate<T> + 'static) -> AppLauncher<T>
pub fn delegate(self, delegate: impl AppDelegate<T> + 'static) -> AppLauncher<T>
Set the AppDelegate
.
pub fn start_console_logging(self, enable: bool) -> AppLauncher<T>
pub fn start_console_logging(self, enable: bool) -> AppLauncher<T>
Initialize a minimal tracing subscriber with DEBUG max level for printing logs out to stderr.
This is meant for quick-and-dirty debugging. If you want more serious trace handling, it’s probably better to implement it yourself.
Panics
Panics if enable
is true
and the subscriber fails to initialize,
for example if a tracing
/tracing_wasm
global logger was already set.
Never panics when enable
is false
, or have any other side effect.
Passing in false is useful if you want to enable a global logger as feature but log to console otherwise.
pub fn log_to_console(self) -> AppLauncher<T>
pub fn log_to_console(self) -> AppLauncher<T>
Calls start_console_logging
with true
.
pub fn localization_resources(
self,
resources: Vec<String, Global>,
base_dir: String
) -> AppLauncher<T>
pub fn localization_resources( self, resources: Vec<String, Global>, base_dir: String ) -> AppLauncher<T>
Use custom localization resource
resources
is a list of file names that contain strings. base_dir
is a path to a directory that includes per-locale subdirectories.
This directory should be of the structure base_dir/{locale}/{resource}
,
where ‘{locale}’ is a valid BCP47 language tag, and {resource} is a .ftl
included in resources
.
pub fn get_external_handle(&self) -> ExtEventSink
pub fn get_external_handle(&self) -> ExtEventSink
Returns an ExtEventSink
that can be moved between threads,
and can be used to submit commands back to the application.