Function relm4::main_application

source ·
pub fn main_application() -> Application
Expand description

Returns the global gtk::Application that’s used internally by RelmApp.

Retrieving this value can be useful for graceful shutdown by calling [ApplicationExt::quit()][gtk::prelude::ApplicationExt::quit] on it.

Note: The global application can be overwritten by calling RelmApp::with_app().

Examples found in repository?
src/app.rs (line 25)
23
24
25
26
27
28
29
    pub fn new(app_id: &str) -> Self {
        crate::init();
        let app = crate::main_application();
        app.set_application_id(Some(app_id));

        Self { app }
    }