Macro relm::connect
[−]
[src]
macro_rules! connect { ($widget:expr, $event:ident($($args:pat),*), $other_component:expr, $msg:expr) => { ... }; ($relm:expr, $widget:expr, $event:ident($($args:pat),*), return $msg:expr) => { ... }; ($relm:expr, $widget:expr, $event:ident($($args:pat),*), $msg:expr) => { ... }; ($src_component:ident @ $message:pat, $dst_component:expr, $msg:expr) => { ... }; }
Connect events to sending a message.
Rules
Send
$msg
to$other_component
when the GTK+$event
is emitted on$widget
.Optionally send
$msg.0
when the GTK+$event
is emitted on$widget
. Return$msg.1
in the GTK+ callback. This variant gives more control to the caller since it expects a$msg
returning(Option<MSG>, ReturnValue)
where theReturnValue
is the value to return in the GTK+ callback. Optioncan be None if no message needs to be emitted. Send
$msg
when the GTK+$event
is emitted on$widget
.Send
$msg
to$widget
when the$message
is received on$stream
.