Trait relm4::prelude::RelmWidgetExt
source · pub trait RelmWidgetExt {
// Required methods
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§
sourcefn set_size_group(&self, size_group: &SizeGroup)
fn set_size_group(&self, size_group: &SizeGroup)
Attach widget to a gtk::SizeGroup
.
sourcefn toplevel_window(&self) -> Option<Window>
fn toplevel_window(&self) -> Option<Window>
Locate the top level window this widget is attached to.
Equivalent to widget.ancestor(gtk::Window::static_type())
, then casting.
sourcefn set_margin_all(&self, margin: i32)
fn set_margin_all(&self, margin: i32)
Set margin at start, end, top and bottom all at once.
sourcefn set_class_active(&self, class: &str, active: bool)
fn set_class_active(&self, class: &str, active: bool)
sourcefn inline_css(&self, style: &str)
fn inline_css(&self, style: &str)
Add inline CSS instructions to a widget.
widget.inline_css("border: 1px solid red");