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.rs
- examples/factory_async.rs
- examples/factory_hash_map.rs
- examples/worker.rs
- examples/actions.rs
- examples/popover.rs
- examples/drawing.rs
- examples/tab_game.rs
- examples/components.rs
- examples/tab_factory.rs
- examples/grid_factory.rs
- examples/simple_manual.rs
- examples/leaflet_sidebar.rs
- examples/message_broker.rs
- examples/message_stream.rs
- examples/typed_grid_view.rs
- examples/typed_list_view.rs
- examples/transient_dialog.rs
- examples/typed_column_view.rs
- examples/progress.rs
- examples/simple_async.rs
- examples/non_blocking_async.rs
- examples/non_blocking_sync.rs
- examples/widget_template.rs
- examples/typed_list_view_async.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 visible_on_activate(self, visible: bool) -> Self
pub fn visible_on_activate(self, visible: bool) -> Self
If true
, make the window visible whenever
the app is activated (e. g. every time RelmApp::run
is called).
By default, this value is true
.
If you don’t want the window to be visible immediately
(especially when using async components), you can set this
to false
and call WidgetExt::set_visible()
manually
on your window.
sourcepub fn set_global_css(&self, style_data: &str)
pub fn set_global_css(&self, style_data: &str)
Sets a custom global stylesheet.
sourcepub fn set_global_css_from_file<P: AsRef<Path>>(
&self,
path: P
) -> Result<(), Error>
pub fn set_global_css_from_file<P: AsRef<Path>>( &self, path: P ) -> Result<(), Error>
Sets a custom global stylesheet from a file.
If the file doesn’t exist a tracing::error
message will be emitted and
an std::io::Error
will be returned.
sourcepub fn run<C>(self, payload: C::Init)
pub fn run<C>(self, payload: C::Init)
Runs the application, returns once the application is closed.
Examples found in repository?
More examples
- examples/factory.rs
- examples/factory_async.rs
- examples/factory_hash_map.rs
- examples/worker.rs
- examples/actions.rs
- examples/popover.rs
- examples/drawing.rs
- examples/tab_game.rs
- examples/components.rs
- examples/tab_factory.rs
- examples/grid_factory.rs
- examples/simple_manual.rs
- examples/leaflet_sidebar.rs
- examples/message_broker.rs
- examples/message_stream.rs
- examples/typed_grid_view.rs
- examples/typed_list_view.rs
- examples/transient_dialog.rs
- examples/typed_column_view.rs
- examples/progress.rs
- examples/non_blocking_async.rs
- examples/non_blocking_sync.rs
- examples/widget_template.rs
- examples/typed_list_view_async.rs
- examples/macro_reference.rs
- examples/tracker.rs
- examples/log.rs