gtk4::prelude

Trait BoxExt

Source
pub trait BoxExt:
    IsA<Box>
    + Sealed
    + 'static {
Show 17 methods // Provided methods fn append(&self, child: &impl IsA<Widget>) { ... } fn baseline_child(&self) -> i32 { ... } fn baseline_position(&self) -> BaselinePosition { ... } fn is_homogeneous(&self) -> bool { ... } fn spacing(&self) -> i32 { ... } fn insert_child_after( &self, child: &impl IsA<Widget>, sibling: Option<&impl IsA<Widget>>, ) { ... } fn prepend(&self, child: &impl IsA<Widget>) { ... } fn remove(&self, child: &impl IsA<Widget>) { ... } fn reorder_child_after( &self, child: &impl IsA<Widget>, sibling: Option<&impl IsA<Widget>>, ) { ... } fn set_baseline_child(&self, child: i32) { ... } fn set_baseline_position(&self, position: BaselinePosition) { ... } fn set_homogeneous(&self, homogeneous: bool) { ... } fn set_spacing(&self, spacing: i32) { ... } fn connect_baseline_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } 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

Box, ShortcutsGroup, ShortcutsSection

Provided Methods§

Source

fn append(&self, child: &impl IsA<Widget>)

Adds a child at the end.

§child

the widget to append

Source

fn baseline_child(&self) -> i32

Available on crate feature v4_12 only.

Gets the value set by set_baseline_child().

§Returns

the baseline child

Source

fn baseline_position(&self) -> BaselinePosition

Gets the value set by set_baseline_position().

§Returns

the baseline position

Source

fn is_homogeneous(&self) -> bool

Returns whether the box is homogeneous.

In a homogeneous box all children are the same size.

§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 insert_child_after( &self, child: &impl IsA<Widget>, sibling: Option<&impl IsA<Widget>>, )

Inserts a child at a specific position.

The child is added after @sibling in the list of @self children.

If @sibling is NULL, the @child is placed at the beginning.

§child

the widget to insert

§sibling

the sibling after which to insert @child

Source

fn prepend(&self, child: &impl IsA<Widget>)

Adds a child at the beginning.

§child

the widget to prepend

Source

fn remove(&self, child: &impl IsA<Widget>)

Removes a child widget from the box.

The child must have been added before with append(), prepend(), or insert_child_after().

§child

the child to remove

Source

fn reorder_child_after( &self, child: &impl IsA<Widget>, sibling: Option<&impl IsA<Widget>>, )

Moves a child to a different position.

The child is moved to the position after @sibling in the list of @self children.

If @sibling is NULL, the child is placed at the beginning.

§child

the widget to move, must be a child of @self

§sibling

the sibling to move @child after

Source

fn set_baseline_child(&self, child: i32)

Available on crate feature v4_12 only.

Sets the baseline child of a box.

This affects only vertical boxes.

§child

a child position, or -1

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 with respect to the extra space available.

§position

the baseline position

Source

fn set_homogeneous(&self, homogeneous: bool)

Sets whether or not all children are given equal space in the box.

§homogeneous

true to create equal allotments, false for variable allotments

Source

fn set_spacing(&self, spacing: i32)

Sets the number of pixels to place between children.

§spacing

the number of pixels to put between children

Source

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

Available on crate feature v4_12 only.
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", so this trait is not object safe.

Implementors§

Source§

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