Trait gtk::prelude::SizeGroupExt
source · [−]pub trait SizeGroupExt: 'static {
fn add_widget(&self, widget: &impl IsA<Widget>);
fn mode(&self) -> SizeGroupMode;
fn widgets(&self) -> Vec<Widget>;
fn remove_widget(&self, widget: &impl IsA<Widget>);
fn set_mode(&self, mode: SizeGroupMode);
fn connect_mode_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn add_widget(&self, widget: &impl IsA<Widget>)
fn add_widget(&self, widget: &impl IsA<Widget>)
Adds a widget to a SizeGroup
. In the future, the requisition
of the widget will be determined as the maximum of its requisition
and the requisition of the other widgets in the size group.
Whether this applies horizontally, vertically, or in both directions
depends on the mode of the size group. See set_mode()
.
When the widget is destroyed or no longer referenced elsewhere, it will be removed from the size group.
widget
the Widget
to add
sourcefn mode(&self) -> SizeGroupMode
fn mode(&self) -> SizeGroupMode
Gets the current mode of the size group. See set_mode()
.
Returns
the current mode of the size group.
sourcefn widgets(&self) -> Vec<Widget>
fn widgets(&self) -> Vec<Widget>
Returns the list of widgets associated with self
.
Returns
a GSList
of
widgets. The list is owned by GTK+ and should not be modified.
sourcefn remove_widget(&self, widget: &impl IsA<Widget>)
fn remove_widget(&self, widget: &impl IsA<Widget>)
sourcefn set_mode(&self, mode: SizeGroupMode)
fn set_mode(&self, mode: SizeGroupMode)
Sets the SizeGroupMode
of the size group. The mode of the size
group determines whether the widgets in the size group should
all have the same horizontal requisition (SizeGroupMode::Horizontal
)
all have the same vertical requisition (SizeGroupMode::Vertical
),
or should all have the same requisition in both directions
(SizeGroupMode::Both
).
mode
the mode to set for the size group.