Trait gtk4::prelude::BoxExt

source ·
pub trait BoxExt: 'static {
Show 14 methods // Required methods fn append(&self, child: &impl IsA<Widget>); 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_position(&self, position: BaselinePosition); fn set_homogeneous(&self, homogeneous: bool); fn set_spacing(&self, spacing: 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

Box, ShortcutsGroup, ShortcutsSection

Required Methods§

source

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

Adds @child as the last child to @self.

child

the Widget to append

source

fn baseline_position(&self) -> BaselinePosition

Gets the value set by gtk_box_set_baseline_position().

Returns

the baseline position

source

fn is_homogeneous(&self) -> bool

Returns whether the box is homogeneous (all children are the same size).

Returns

true if the box is homogeneous.

source

fn spacing(&self) -> i32

Gets the value set by gtk_box_set_spacing().

Returns

spacing between children

source

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

Inserts @child in the position after @sibling in the list of @self children.

If @sibling is None, insert @child at the first position.

child

the Widget to insert

sibling

the sibling after which to insert @child

source

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

Adds @child as the first child to @self.

child

the Widget to prepend

source

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

Removes a child widget from @self.

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 @child to the position after @sibling in the list of @self children.

If @sibling is None, move @child to the first position.

child

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

sibling

the sibling to move @child after

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

a BaselinePosition

source

fn set_homogeneous(&self, homogeneous: bool)

Sets 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 number of pixels to place between children of @self.

spacing

the number of pixels to put between children

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

Implementors§

source§

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