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
- relm4/examples/factory.rs
- relm4/examples/factory_async.rs
- relm4/examples/factory_hash_map.rs
- relm4/examples/worker.rs
- relm4/examples/actions.rs
- relm4/examples/popover.rs
- relm4/examples/drawing.rs
- relm4/examples/tab_game.rs
- relm4-components/examples/combo_box.rs
- relm4/examples/components.rs
- relm4/examples/simple.rs
- relm4/examples/tab_factory.rs
- relm4-components/examples/open_button.rs
- relm4-components/examples/web_image.rs
- relm4/examples/grid_factory.rs
- relm4/examples/multi_window.rs
- relm4-components/examples/file_dialogs.rs
- relm4/examples/embedded_logo.rs
- relm4-components/examples/adw_combo_row.rs
- relm4/examples/leaflet_sidebar.rs
- relm4/examples/message_broker.rs
- relm4/examples/message_stream.rs
- relm4/examples/typed_grid_view.rs
- relm4/examples/typed_list_view.rs
- relm4/examples/transient_dialog.rs
- relm4/examples/typed_column_view.rs
- relm4/examples/progress.rs
- relm4/examples/simple_manual.rs
- relm4/examples/split_layout.rs
- relm4/examples/state_management.rs
- relm4/examples/drag_and_drop.rs
- relm4/examples/non_blocking_async.rs
- relm4/examples/non_blocking_sync.rs
- relm4/examples/drop_sub_components.rs
- relm4/examples/widget_template.rs
- relm4/examples/typed_list_view_async.rs
- relm4/examples/message_from_grid_view.rs
- relm4/examples/simple_async.rs
- relm4/examples/navigation_splitview_with_stack.rs
- relm4/examples/macro_reference.rs
- relm4/examples/tracker.rs
- relm4/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 allow_multiple_instances(&self, allow: bool)
pub fn allow_multiple_instances(&self, allow: bool)
If true, allow multiple concurrent instances of the application
by setting the gtk::gio::ApplicationFlags::NON_UNIQUE flag.
By default, this flag is not set. When the flag is not set, the application will not be started if another instance is already running.
Sourcepub fn set_global_css_with_priority(&self, style_data: &str, priority: u32)
👎Deprecated: Use relm4::set_global_css_with_priority instead
pub fn set_global_css_with_priority(&self, style_data: &str, priority: u32)
relm4::set_global_css_with_priority insteadSets a custom global stylesheet, with the given priority.
The priority can be any value, but GTK includes some that you can use.
Sourcepub fn set_global_css(&self, style_data: &str)
👎Deprecated: Use relm4::set_global_css instead
pub fn set_global_css(&self, style_data: &str)
relm4::set_global_css insteadSets a custom global stylesheet.
Sourcepub fn set_global_css_from_file_with_priority<P: AsRef<Path>>(
&self,
path: P,
priority: u32,
) -> Result<(), Error>
👎Deprecated: Use relm4::set_global_css_from_file_with_priority instead
pub fn set_global_css_from_file_with_priority<P: AsRef<Path>>( &self, path: P, priority: u32, ) -> Result<(), Error>
relm4::set_global_css_from_file_with_priority insteadSets a custom global stylesheet from a file, with the given priority.
If the file doesn’t exist a tracing::error message will be emitted and
an std::io::Error will be returned.
The priority can be any value, but GTK includes some that you can use.
Sourcepub fn set_global_css_from_file<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), Error>
👎Deprecated: Use relm4::set_global_css_from_file instead
pub fn set_global_css_from_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), Error>
relm4::set_global_css_from_file insteadSets 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
- relm4/examples/factory.rs
- relm4/examples/factory_async.rs
- relm4/examples/factory_hash_map.rs
- relm4/examples/worker.rs
- relm4/examples/actions.rs
- relm4/examples/popover.rs
- relm4/examples/drawing.rs
- relm4/examples/tab_game.rs
- relm4-components/examples/combo_box.rs
- relm4/examples/components.rs
- relm4/examples/simple.rs
- relm4/examples/tab_factory.rs
- relm4-components/examples/open_button.rs
- relm4-components/examples/web_image.rs
- relm4/examples/grid_factory.rs
- relm4/examples/multi_window.rs
- relm4-components/examples/file_dialogs.rs
- relm4/examples/embedded_logo.rs
- relm4-components/examples/adw_combo_row.rs
- relm4/examples/leaflet_sidebar.rs
- relm4/examples/message_broker.rs
- relm4/examples/message_stream.rs
- relm4/examples/typed_grid_view.rs
- relm4/examples/typed_list_view.rs
- relm4/examples/transient_dialog.rs
- relm4/examples/typed_column_view.rs
- relm4/examples/progress.rs
- relm4/examples/simple_manual.rs
- relm4/examples/split_layout.rs
- relm4/examples/state_management.rs
- relm4/examples/drag_and_drop.rs
- relm4/examples/non_blocking_async.rs
- relm4/examples/non_blocking_sync.rs
- relm4/examples/drop_sub_components.rs
- relm4/examples/widget_template.rs
- relm4/examples/typed_list_view_async.rs
- relm4/examples/message_from_grid_view.rs
- relm4/examples/navigation_splitview_with_stack.rs
- relm4/examples/macro_reference.rs
- relm4/examples/tracker.rs
- relm4/examples/log.rs