Expand description
An idiomatic GUI library inspired by Elm and based on gtk4-rs
Re-exports
pub use util::widget_plus::WidgetPlus;
pub use util::WidgetRef;
pub use gtk;
pub use adw;
pub use panel;
Modules
- Action utility.
- Utility to help drawing on a
gtk::DrawingArea
in a Relm4 application. Create aDrawHandler
, 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.
Macros
- 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.
Structs
- AsyncRelmWorker
tokio-rt
AAsyncRelmWorker
is like aRelmWorker
but runs theAsyncComponentUpdate::update
function in a tokioRuntime
. - 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.
RelmMsgHandler
s 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 aRelmMsgHandler
for sending a HTTP request or for copying files.RelmWorker
s are likeRelmComponent
s but they don’t have any widgets.- A
Sender
that can be used to send items to the corresponding main context receiver.
Enums
- Errors which might get returned from
MicroComponent::update_view
method
Traits
- Define the behavior to update the model of the main app.
- AsyncComponentUpdate
tokio-rt
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.
Functions
- 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
- async_trait
tokio-rt
Re-export ofasync_trait::async_trait
- 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.