pub struct RelmApp { /* private fields */ }
Expand description
An app that runs the main application.
Implementations§
source§impl RelmApp
impl RelmApp
sourcepub fn new(app_id: &str) -> Self
pub fn new(app_id: &str) -> Self
Create a new Relm4 application.
This function will create a new gtk::Application
object if necessary.
If the libadwaita
feature is enabled, then the created gtk::Application
will be an
instance of adw::Application
. This can be overridden by passing your own application
object to RelmApp::with_app
.
Examples found in repository?
More examples
- relm4/examples/factory_async.rs
- relm4/examples/worker.rs
- relm4/examples/actions.rs
- relm4/examples/popover.rs
- relm4/examples/drawing.rs
- relm4/examples/components.rs
- relm4-components/examples/open_button.rs
- relm4-components/examples/web_image.rs
- relm4/examples/grid_factory.rs
- relm4-components/examples/file_dialogs.rs
- relm4/examples/simple_manual.rs
- relm4/examples/message_broker.rs
- relm4/examples/message_stream.rs
- relm4/examples/transient_dialog.rs
- relm4/examples/progress.rs
- relm4/examples/simple_async.rs
- relm4/examples/non_blocking_async.rs
- relm4/examples/non_blocking_sync.rs
- relm4/examples/widget_template.rs
- relm4/examples/macro_reference.rs
- relm4/examples/tracker.rs
- relm4/examples/log.rs
sourcepub fn with_app(app: impl IsA<Application>) -> Self
pub fn with_app(app: impl IsA<Application>) -> Self
Create a Relm4 application with a provided gtk::Application
.
sourcepub fn run<C>(self, payload: C::Init)where
C: Component,
C::Root: IsA<Window> + WidgetExt,
pub fn run<C>(self, payload: C::Init)where C: Component, C::Root: IsA<Window> + WidgetExt,
Runs the application, returns once the application is closed.
Unlike gtk::prelude::ApplicationExtManual::run
, this function
does not handle command-line arguments. To pass arguments to GTK, use
RelmApp::run_with_args
.
Examples found in repository?
More examples
- relm4/examples/factory_async.rs
- relm4/examples/worker.rs
- relm4/examples/actions.rs
- relm4/examples/popover.rs
- relm4/examples/drawing.rs
- relm4/examples/components.rs
- relm4-components/examples/open_button.rs
- relm4-components/examples/web_image.rs
- relm4/examples/grid_factory.rs
- relm4-components/examples/file_dialogs.rs
- relm4/examples/simple_manual.rs
- relm4/examples/message_broker.rs
- relm4/examples/message_stream.rs
- relm4/examples/transient_dialog.rs
- relm4/examples/progress.rs
- relm4/examples/non_blocking_async.rs
- relm4/examples/non_blocking_sync.rs
- relm4/examples/widget_template.rs
- relm4/examples/macro_reference.rs
- relm4/examples/tracker.rs
- relm4/examples/log.rs
sourcepub fn run_with_args<C, S>(self, payload: C::Init, args: &[S])where
C: Component,
C::Root: IsA<Window> + WidgetExt,
S: AsRef<str>,
pub fn run_with_args<C, S>(self, payload: C::Init, args: &[S])where C: Component, C::Root: IsA<Window> + WidgetExt, S: AsRef<str>,
Runs the application with the provided command-line arguments, returns once the application is closed.
sourcepub fn run_async<C>(self, payload: C::Init)where
C: AsyncComponent,
C::Root: IsA<Window> + WidgetExt,
pub fn run_async<C>(self, payload: C::Init)where C: AsyncComponent, C::Root: IsA<Window> + WidgetExt,
Runs the application, returns once the application is closed.
Unlike gtk::prelude::ApplicationExtManual::run
, this function
does not handle command-line arguments. To pass arguments to GTK, use
RelmApp::run_with_args
.