Struct relm::Component
[−]
[src]
#[must_use]pub struct Component<WIDGET: Widget>(_)
where
WIDGET::Model: Clone;
Widget that was added by the ContainerWidget::add_widget()
method.
Warning
You must keep your components as long as you want them to send/receive events.
Common practice is to store Component
s in the Widget
struct (see the communication
example).
The #[widget]
attribute takes care of storing them in the struct automatically (see the
communication-attribute example).
Methods
impl<WIDGET: Widget> Component<WIDGET> where
WIDGET::Model: Clone,
[src]
WIDGET::Model: Clone,
fn stream(&self) -> &EventStream<WIDGET::Msg>
Get the event stream of the widget. This is used internally by the library.
fn widget(&self) -> &WIDGET
Get the widget of this component.
Trait Implementations
impl<WIDGET: Clone + Widget> Clone for Component<WIDGET> where
WIDGET::Model: Clone,
[src]
WIDGET::Model: Clone,
fn clone(&self) -> Component<WIDGET>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<WIDGET> RelmContainer for Component<WIDGET> where
WIDGET: Container + Widget,
WIDGET::Container: Clone + ContainerExt + IsA<Widget> + IsA<Object>,
WIDGET::Model: Clone,
[src]
WIDGET: Container + Widget,
WIDGET::Container: Clone + ContainerExt + IsA<Widget> + IsA<Object>,
WIDGET::Model: Clone,
fn add<W: IsA<Widget>>(&self, widget: &W)
Add a GTK+ widget to a relm container.
fn add_widget<CHILDWIDGET, PARENTWIDGET>(
&self,
relm: &RemoteRelm<PARENTWIDGET>
) -> Component<CHILDWIDGET> where
CHILDWIDGET: Widget + 'static,
CHILDWIDGET::Model: Clone + Send,
CHILDWIDGET::Msg: Send,
PARENTWIDGET: Widget,
&self,
relm: &RemoteRelm<PARENTWIDGET>
) -> Component<CHILDWIDGET> where
CHILDWIDGET: Widget + 'static,
CHILDWIDGET::Model: Clone + Send,
CHILDWIDGET::Msg: Send,
PARENTWIDGET: Widget,
Add a relm widget to a relm container.