Struct relm::Component
[−]
[src]
#[must_use]pub struct Component<WIDGET: Widget> { /* fields omitted */ }
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>
[src]
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,
WIDGET::Msg: Clone,
[src]
WIDGET::Model: Clone,
WIDGET::Msg: 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: Widget> Drop for Component<WIDGET>
[src]
impl<WIDGET: Widget> ContainerExt for Component<WIDGET> where
WIDGET::Container: ContainerExt,
[src]
WIDGET::Container: ContainerExt,
fn add<T: IsA<Widget>>(&self, widget: &T)
fn check_resize(&self)
fn child_notify<T: IsA<Widget>>(&self, child: &T, child_property: &str)
fn child_type(&self) -> Type
fn get_border_width(&self) -> u32
fn get_children(&self) -> Vec<Widget>
fn get_focus_child(&self) -> Option<Widget>
fn get_focus_hadjustment(&self) -> Option<Adjustment>
fn get_focus_vadjustment(&self) -> Option<Adjustment>
fn get_resize_mode(&self) -> ResizeMode
fn propagate_draw<T: IsA<Widget>>(&self, child: &T, cr: &Context)
fn remove<T: IsA<Widget>>(&self, widget: &T)
fn resize_children(&self)
fn set_border_width(&self, border_width: u32)
fn set_focus_chain(&self, focusable_widgets: &[Widget])
fn set_focus_child<T: IsA<Widget>>(&self, child: Option<&T>)
fn set_focus_hadjustment(&self, adjustment: &Adjustment)
fn set_focus_vadjustment(&self, adjustment: &Adjustment)
fn set_reallocate_redraws(&self, needs_redraws: bool)
fn set_resize_mode(&self, resize_mode: ResizeMode)
fn unset_focus_chain(&self)
fn set_property_child(&self, child: Option<&Widget>)
fn connect_add<F: Fn(&Self, &Widget) + 'static>(&self, _f: F) -> u64
fn connect_check_resize<F: Fn(&Self) + 'static>(&self, _f: F) -> u64
fn connect_remove<F: Fn(&Self, &Widget) + 'static>(&self, _f: F) -> u64
fn connect_set_focus_child<F: Fn(&Self, &Widget) + 'static>(&self, _f: F) -> u64
impl<WIDGET: ContainerExt + IsA<Widget> + IsA<Object> + Widget> ContainerWidget for Component<WIDGET>
[src]
fn add_widget<CHILDWIDGET, MSG>(
&self,
relm: &RemoteRelm<MSG>
) -> Component<CHILDWIDGET> where
MSG: Clone + DisplayVariant + Send + 'static,
CHILDWIDGET: Widget + 'static,
CHILDWIDGET::Container: IsA<Object> + WidgetExt,
CHILDWIDGET::Model: Send,
CHILDWIDGET::Msg: Clone + DisplayVariant + Send + 'static,
&self,
relm: &RemoteRelm<MSG>
) -> Component<CHILDWIDGET> where
MSG: Clone + DisplayVariant + Send + 'static,
CHILDWIDGET: Widget + 'static,
CHILDWIDGET::Container: IsA<Object> + WidgetExt,
CHILDWIDGET::Model: Send,
CHILDWIDGET::Msg: Clone + DisplayVariant + Send + 'static,
Add a relm Widget
to the current GTK+ container. Read more
fn remove_widget<CHILDWIDGET>(&self, component: Component<CHILDWIDGET>) where
CHILDWIDGET: Widget,
CHILDWIDGET::Container: IsA<Widget>,
CHILDWIDGET: Widget,
CHILDWIDGET::Container: IsA<Widget>,
Remove a relm Widget
from the current GTK+ container.