pub struct RelmApp<M: Debug + 'static> { /* private fields */ }
Expand description
An app that runs the main application.
Implementations§
source§impl<M: Debug + 'static> RelmApp<M>
impl<M: Debug + 'static> RelmApp<M>
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::from_app
.
Examples found in repository?
More examples
- examples/factory_async.rs
- examples/worker.rs
- examples/actions.rs
- examples/popover.rs
- examples/drawing.rs
- examples/components.rs
- examples/grid_factory.rs
- examples/simple_manual.rs
- examples/message_broker.rs
- examples/message_stream.rs
- examples/transient_dialog.rs
- examples/progress.rs
- examples/simple_async.rs
- examples/non_blocking_async.rs
- examples/non_blocking_sync.rs
- examples/widget_template.rs
- examples/macro_reference.rs
- examples/tracker.rs
- examples/log.rs
sourcepub fn from_app(app: impl IsA<Application>) -> Self
pub fn from_app(app: impl IsA<Application>) -> Self
Create a Relm4 application with a provided gtk::Application
.
sourcepub fn with_broker(self, broker: &'static MessageBroker<M>) -> Self
pub fn with_broker(self, broker: &'static MessageBroker<M>) -> Self
Add MessageBroker
to the top-level component.
sourcepub fn run<C>(self, payload: C::Init)where
C: Component<Input = M>,
C::Root: IsA<Window> + WidgetExt,
pub fn run<C>(self, payload: C::Init)where C: Component<Input = M>, C::Root: IsA<Window> + WidgetExt,
Runs the application, returns once the application is closed.
Examples found in repository?
More examples
- examples/factory_async.rs
- examples/worker.rs
- examples/actions.rs
- examples/popover.rs
- examples/drawing.rs
- examples/components.rs
- examples/grid_factory.rs
- examples/simple_manual.rs
- examples/message_broker.rs
- examples/message_stream.rs
- examples/transient_dialog.rs
- examples/progress.rs
- examples/non_blocking_async.rs
- examples/non_blocking_sync.rs
- examples/widget_template.rs
- examples/macro_reference.rs
- examples/tracker.rs
- examples/log.rs
sourcepub fn run_with_args<C, S>(self, payload: C::Init, args: &[S])where
C: Component<Input = M>,
C::Root: IsA<Window> + WidgetExt,
S: AsRef<str>,
👎Deprecated
pub fn run_with_args<C, S>(self, payload: C::Init, args: &[S])where C: Component<Input = M>, 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<Input = M>,
C::Root: IsA<Window> + WidgetExt,
pub fn run_async<C>(self, payload: C::Init)where C: AsyncComponent<Input = M>, C::Root: IsA<Window> + WidgetExt,
Runs the application, returns once the application is closed.
sourcepub fn run_async_with_args<C, S>(self, payload: C::Init, args: &[S])where
C: AsyncComponent<Input = M>,
C::Root: IsA<Window> + WidgetExt,
S: AsRef<str>,
👎Deprecated
pub fn run_async_with_args<C, S>(self, payload: C::Init, args: &[S])where C: AsyncComponent<Input = M>, C::Root: IsA<Window> + WidgetExt, S: AsRef<str>,
Runs the application with the provided command-line arguments, returns once the application is closed.