Skip to main content

BoxExt

Trait BoxExt 

Source
pub trait BoxExt:
    IsA<Box>
    + Sealed
    + 'static {
Show 26 methods // Provided 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

Provided Methods§

Source

fn baseline_position(&self) -> BaselinePosition

Gets the value set by set_baseline_position().

§Returns

the baseline position

Source

fn center_widget(&self) -> Option<Widget>

Retrieves the center widget of the box.

§Returns

the center widget or None in case no center widget is set.

Source

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.

Source

fn spacing(&self) -> i32

Gets the value set by set_spacing().

§Returns

spacing between children

Source

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 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

Source

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 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

Source

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

Source

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

Source

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

a BaselinePosition

Source

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

Source

fn set_child_packing( &self, child: &impl IsA<Widget>, expand: bool, fill: bool, padding: u32, pack_type: PackType, )

Sets the way child is packed into self.

§child

the Widget of the child to set

§expand

the new value of the expand child property

§fill

the new value of the fill child property

§padding

the new value of the padding child property

§pack_type

the new value of the pack-type child property

Source

fn set_homogeneous(&self, homogeneous: bool)

Sets the 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

Source

fn set_spacing(&self, spacing: i32)

Sets the 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

Source

fn child_expands<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_expand<T: IsA<Widget>>(&self, item: &T, expand: bool)

Source

fn child_fills<T: IsA<Widget>>(&self, item: &T) -> bool

Source

fn set_child_fill<T: IsA<Widget>>(&self, item: &T, fill: bool)

Source

fn child_pack_type<T: IsA<Widget>>(&self, item: &T) -> PackType

Source

fn set_child_pack_type<T: IsA<Widget>>(&self, item: &T, pack_type: PackType)

Source

fn child_padding<T: IsA<Widget>>(&self, item: &T) -> u32

Source

fn set_child_padding<T: IsA<Widget>>(&self, item: &T, padding: u32)

Source

fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32

Source

fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32)

Source

fn connect_baseline_position_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_homogeneous_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_spacing_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<O: IsA<Box>> BoxExt for O