Expand description
Asynchronous GUI library based on GTK+.
This library provides a Widget
trait that you can use to create asynchronous GUI components.
This is the trait you will need to implement for your application.
It helps you to implement MVC (Model, View, Controller) in an elegant way.
§Installation
Add this to your Cargo.toml
:
[dependencies]
gtk = "^0.6.0"
relm = "^0.16.0"
relm-derive = "^0.16.0"
More info can be found in the readme.
Macros§
- connect
- Connect events to sending a message.
- connect_
async - Connect an asynchronous method call to send a message.
The variants with
$fail_msg
will send this message when there’s an error. Those without this argument will ignore the error. - connect_
async_ full - Like
connect_async!
, but also return aCancellable
to control the asynchronous request. - connect_
async_ func - Connect an asynchronous function call to send a message.
The variants with
$fail_msg
will send this message when there’s an error. Those without this argument will ignore the error. - connect_
async_ func_ full - Like
connect_async_func!
, but also return aCancellable
to control the asynchronous request. - connect_
stream - Connect events to sending a message.
Similar to
connect!
but wants a stream instead of a component. - impl_
widget - Dummy macro to be used with
#[derive(Widget)]
.
Structs§
- Channel
- A channel to send a message to a relm widget from another thread.
- Component
- Widget that was added by the
ContainerWidget::add_widget()
method. - Container
Component - Struct for relm containers to add GTK+ and relm
Widget
s. - Draw
Handler - Manager for drawing operations.
- Event
Stream - A stream of messages to be used for widget/signal communication and inter-widget communication.
EventStream cannot be send to another thread. Use a
Channel
Sender
instead. - Relm
- Handle event stream to send messages to the
update()
method. - Sender
- A wrapper over a
std::sync::mpsc::Sender
to wakeup the glib event loop when sending a message. - Stream
Handle - Handle to a EventStream to emit messages.
Traits§
- Container
- Trait to implement relm container widget.
- Container
Widget - Extension trait for GTK+ containers to add and remove relm
Widget
s. - Display
Variant - Format trait for enum variants.
- Update
- Trait for a basic (non-widget) component.
A component has a model (data) associated with it and can mutate it when it receives a message
(in the
update()
method). - Update
New - Trait for an
Update
object that can be created directly. This is useful for non-widget component. - Widget
- Trait to implement to manage widget’s events.
- Widget
Test - Trait implemented by the generator to ease the creation of tests of relm widgets using the view! macro.
Functions§
- create_
component - Create a new relm widget without adding it to an existing widget. This is useful when a relm widget is at the root of another relm widget.
- create_
container - Create a new relm container widget without adding it to an existing widget. This is useful when a relm widget is at the root of another relm widget.
- execute
- Create a bare component, i.e. a component only implementing the Update trait, not the Widget trait.
- init
- Initialize a widget.
- init_
test - Initialize a widget for a test.
- interval
- Emit the
msg
everyduration
ms. - run
- Create the specified relm
Widget
and run the main event loops. - timeout
- After
duration
ms, emitmsg
.