pub trait RelmWidgetExt {
    fn set_size_group(&self, size_group: &SizeGroup);
    fn toplevel_window(&self) -> Option<Window>;
    fn set_margin_all(&self, margin: i32);
    fn set_class_active(&self, class: &str, active: bool);
    fn inline_css(&self, style: &str);
Expand description

Trait that extends gtk::prelude::WidgetExt.

This trait’s main goal is to reduce redundant code and to provide helpful methods for the widgets macro of relm4-macros.

Required Methods§

Attach widget to a gtk::SizeGroup.

Locate the top level window this widget is attached to.

Equivalent to widget.ancestor(gtk::Window::static_type()), then casting.

Set margin at start, end, top and bottom all at once.

Add class name if active is true and remove class name if active is false

Add inline CSS instructions to a widget.

widget.inline_css("border: 1px solid red");