pub trait BoxExt: 'static {
Show 26 methods
fn baseline_position(&self) -> BaselinePosition;
fn center_widget(&self) -> Option<Widget>;
fn is_homogeneous(&self) -> bool;
fn spacing(&self) -> i32;
fn pack_end(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32
);
fn pack_start(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32
);
fn query_child_packing(
&self,
child: &impl IsA<Widget>
) -> (bool, bool, u32, PackType);
fn reorder_child(&self, child: &impl IsA<Widget>, position: i32);
fn set_baseline_position(&self, position: BaselinePosition);
fn set_center_widget(&self, widget: Option<&impl IsA<Widget>>);
fn set_child_packing(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32,
pack_type: PackType
);
fn set_homogeneous(&self, homogeneous: bool);
fn set_spacing(&self, spacing: i32);
fn child_expands<T: IsA<Widget>>(&self, item: &T) -> bool;
fn set_child_expand<T: IsA<Widget>>(&self, item: &T, expand: bool);
fn child_fills<T: IsA<Widget>>(&self, item: &T) -> bool;
fn set_child_fill<T: IsA<Widget>>(&self, item: &T, fill: bool);
fn child_pack_type<T: IsA<Widget>>(&self, item: &T) -> PackType;
fn set_child_pack_type<T: IsA<Widget>>(&self, item: &T, pack_type: PackType);
fn child_padding<T: IsA<Widget>>(&self, item: &T) -> u32;
fn set_child_padding<T: IsA<Widget>>(&self, item: &T, padding: u32);
fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32);
fn connect_baseline_position_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_homogeneous_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_spacing_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}
Expand description
Trait containing all Box
methods.
Implementors
AppChooserWidget
, Box
, ButtonBox
, ColorChooserWidget
, FileChooserButton
, FileChooserWidget
, FontChooserWidget
, InfoBar
, RecentChooserWidget
, ShortcutLabel
, ShortcutsGroup
, ShortcutsSection
, ShortcutsShortcut
, StackSwitcher
, Statusbar
Required Methods
sourcefn baseline_position(&self) -> BaselinePosition
fn baseline_position(&self) -> BaselinePosition
sourcefn center_widget(&self) -> Option<Widget>
fn center_widget(&self) -> Option<Widget>
sourcefn is_homogeneous(&self) -> bool
fn is_homogeneous(&self) -> bool
Returns whether the box is homogeneous (all children are the
same size). See set_homogeneous()
.
Returns
true
if the box is homogeneous.
sourcefn pack_end(&self, child: &impl IsA<Widget>, expand: bool, fill: bool, padding: u32)
fn pack_end(&self, child: &impl IsA<Widget>, expand: bool, fill: bool, padding: u32)
Adds child
to self
, packed with reference to the end of self
.
The child
is packed after (away from end of) any other child
packed with reference to the end of self
.
child
the Widget
to be added to self
expand
true
if the new child is to be given extra space allocated
to self
. The extra space will be divided evenly between all children
of self
that use this option
fill
true
if space given to child
by the expand
option is
actually allocated to child
, rather than just padding it. This
parameter has no effect if expand
is set to false
. A child is
always allocated the full height of a horizontal Box
and the full width
of a vertical Box
. This option affects the other dimension
padding
extra space in pixels to put between this child and its
neighbors, over and above the global amount specified by
property::Box::spacing
property. If child
is a widget at one of the
reference ends of self
, then padding
pixels are also put between
child
and the reference edge of self
sourcefn pack_start(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32
)
fn pack_start(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32
)
Adds child
to self
, packed with reference to the start of self
.
The child
is packed after any other child packed with reference
to the start of self
.
child
the Widget
to be added to self
expand
true
if the new child is to be given extra space allocated
to self
. The extra space will be divided evenly between all children
that use this option
fill
true
if space given to child
by the expand
option is
actually allocated to child
, rather than just padding it. This
parameter has no effect if expand
is set to false
. A child is
always allocated the full height of a horizontal Box
and the full width
of a vertical Box
. This option affects the other dimension
padding
extra space in pixels to put between this child and its
neighbors, over and above the global amount specified by
property::Box::spacing
property. If child
is a widget at one of the
reference ends of self
, then padding
pixels are also put between
child
and the reference edge of self
sourcefn query_child_packing(
&self,
child: &impl IsA<Widget>
) -> (bool, bool, u32, PackType)
fn query_child_packing(
&self,
child: &impl IsA<Widget>
) -> (bool, bool, u32, PackType)
Obtains information about how child
is packed into self
.
child
the Widget
of the child to query
Returns
expand
pointer to return location for expand child property
fill
pointer to return location for fill child property
padding
pointer to return location for padding child property
pack_type
pointer to return location for pack-type child property
sourcefn reorder_child(&self, child: &impl IsA<Widget>, position: i32)
fn reorder_child(&self, child: &impl IsA<Widget>, position: i32)
Moves child
to a new position
in the list of self
children.
The list contains widgets packed PackType::Start
as well as widgets packed PackType::End
, in the order that these
widgets were added to self
.
A widget’s position in the self
children list determines where
the widget is packed into self
. A child widget at some position
in the list will be packed just after all other widgets of the
same packing type that appear earlier in the list.
child
the Widget
to move
position
the new position for child
in the list of children
of self
, starting from 0. If negative, indicates the end of
the list
sourcefn set_baseline_position(&self, position: BaselinePosition)
fn set_baseline_position(&self, position: BaselinePosition)
Sets the baseline position of a box. This affects
only horizontal boxes with at least one baseline aligned
child. If there is more vertical space available than requested,
and the baseline is not allocated by the parent then
position
is used to allocate the baseline wrt the
extra space available.
position
sourcefn set_center_widget(&self, widget: Option<&impl IsA<Widget>>)
fn set_center_widget(&self, widget: Option<&impl IsA<Widget>>)
Sets a center widget; that is a child widget that will be centered with respect to the full width of the box, even if the children at either side take up different amounts of space.
widget
the widget to center
sourcefn set_child_packing(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32,
pack_type: PackType
)
fn set_child_packing(
&self,
child: &impl IsA<Widget>,
expand: bool,
fill: bool,
padding: u32,
pack_type: PackType
)
sourcefn set_homogeneous(&self, homogeneous: bool)
fn set_homogeneous(&self, homogeneous: bool)
Sets the property::Box::homogeneous
property of self
, controlling
whether or not all children of self
are given equal space
in the box.
homogeneous
a boolean value, true
to create equal allotments,
false
for variable allotments
sourcefn set_spacing(&self, spacing: i32)
fn set_spacing(&self, spacing: i32)
Sets the property::Box::spacing
property of self
, which is the
number of pixels to place between children of self
.
spacing
the number of pixels to put between children