Crate relm4

source · []
Expand description

An idiomatic GUI library inspired by Elm and based on gtk4-rs


pub use util::widget_plus::WidgetPlus;
pub use util::WidgetRef;
pub use gtk;
pub use adw;
pub use panel;


Action utility.

Utility to help drawing on a gtk::DrawingArea in a Relm4 application. Create a DrawHandler, initialize it, and get its context when handling a message (that could be sent from the draw signal).

Defines traits and data types used to efficiently generating widgets from collections.

Utility traits for working with GTK widgets.


A macro to create menus.

Create a new type that implements ActionGroupName.

Create a new type that implements ActionName with state and target type.

Create a new type that implements ActionName without state or target type.

A short macro for conveniently sending messages.

The view! macro allows you to construct your UI easily and cleanly.


A AsyncRelmWorker is like a RelmWorker but runs the AsyncComponentUpdate::update function in a tokio Runtime.

MicroComponent is a small component that lives in their parents model, can be modified from their parents model but at the same time have their own widgets and update function

The app that runs the main application. A RelmApp consists of a model that stores the application state and widgets that represent the UI.

A component that can be part of the main application or other components.

RelmMsgHandlers are usually used to run expansive tasks on different threads and report back when they are finished so that their parent components can keep handling UI events in the meantime. For example you could use a RelmMsgHandler for sending a HTTP request or for copying files.

RelmWorkers are like RelmComponents but they don’t have any widgets.

A Sender that can be used to send items to the corresponding main context receiver.


Errors which might get returned from MicroComponent::update_view method


Define the behavior to update the model of the main app.

ComponentUpdate for asynchronous workers and components.

Define the behavior to initialize and update a component or worker.

Define how to initialize one or more components.

A message handler that can be used in situations where a RelmWorker isn’t flexible enough.

Trait that defines the types associated with model used by MicroComponent

Define behavior to turn the data of your MicroModel into widgets.

Trait that defines the types associated with the model.

Define behavior to turn the data of you model into widgets.


Returns the application created by RelmApp::new.

Sets a custom global stylesheet.

Sets a custom global stylesheet from a file.

Spawns a future on the main thread in the main event loop.

Attribute Macros

Macro that implements relm4::factory::FactoryPrototype and generates the corresponding widget struct.

Macro that implements relm4::MicrosWidgets and generates the corresponding struct.

Macro that implements relm4::Widgets and generates the corresponding struct.

Derive Macros