[]Struct gtk::Box

pub struct Box(_, _);

The Box widget arranges child widgets into a single row or column, depending upon the value of its Orientable:orientation property. Within the other dimension, all children are allocated the same size. Of course, the Widget:halign and Widget:valign properties can be used on the children to influence their allocation.

Box uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a Container. For a Box, there are two reference positions: the start and the end of the box. For a vertical Box, the start is defined as the top of the box and the end is defined as the bottom. For a horizontal Box the start is defined as the left side and the end is defined as the right side.

Use repeated calls to BoxExt::pack_start to pack widgets into a Box from start to end. Use BoxExt::pack_end to add widgets from end to start. You may intersperse these calls and add widgets from both ends of the same Box.

Because Box is a Container, you may also use ContainerExt::add to insert widgets into the box, and they will be packed with the default values for expand and fill child properties. Use ContainerExt::remove to remove widgets from the Box.

Use BoxExt::set_homogeneous to specify whether or not all children of the Box are forced to get the same amount of space.

Use BoxExt::set_spacing to determine how much space will be minimally placed between all children in the Box. Note that spacing is added between the children, while padding added by BoxExt::pack_start or BoxExt::pack_end is added on either side of the widget it belongs to.

Use BoxExt::reorder_child to move a Box child to a different place in the box.

Use BoxExt::set_child_packing to reset the expand, fill and padding child properties. Use BoxExt::query_child_packing to query these fields.

CSS nodes

Box uses a single CSS node with name box.

In horizontal orientation, the nodes of the children are always arranged from left to right. So :first-child will always select the leftmost child, regardless of text direction.

Implements

BoxExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, OrientableExt, WidgetExtManual, BuildableExtManual

Methods

impl Box[src]

pub fn new(orientation: Orientation, spacing: i32) -> Box[src]

Creates a new Box.

orientation

the box’s orientation.

spacing

the number of pixels to place by default between children.

Returns

a new Box.

Trait Implementations

impl<T: ObjectType> PartialOrd<T> for Box

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Eq for Box

impl<T: ObjectType> PartialEq<T> for Box

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Ord for Box

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Clone for Box

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Hash for Box

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for Box[src]

impl Debug for Box

impl IsA<Box> for AppChooserWidget

impl IsA<Container> for Box

impl IsA<Widget> for Box

impl IsA<Buildable> for Box

impl IsA<Orientable> for Box

impl IsA<Box> for ButtonBox

impl IsA<Box> for ColorChooserWidget

impl IsA<Box> for FileChooserButton

impl IsA<Box> for FileChooserWidget

impl IsA<Box> for FontChooserWidget

impl IsA<Box> for InfoBar

impl IsA<Box> for RecentChooserWidget

impl IsA<Box> for StackSwitcher

impl IsA<Box> for Statusbar

impl StaticType for Box

Auto Trait Implementations

impl Unpin for Box

impl !Sync for Box

impl !Send for Box

impl UnwindSafe for Box

impl RefUnwindSafe for Box

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> Cast for T where
    T: ObjectType

fn upcast<T>(self) -> T where
    Self: IsA<T>,
    T: ObjectType

Upcasts an object to a superclass or interface T. Read more

fn upcast_ref<T>(&self) -> &T where
    Self: IsA<T>,
    T: ObjectType

Upcasts an object to a reference of its superclass or interface T. Read more

fn downcast<T>(self) -> Result<T, Self> where
    Self: CanDowncast<T>,
    T: ObjectType

Tries to downcast to a subclass or interface implementor T. Read more

fn downcast_ref<T>(&self) -> Option<&T> where
    Self: CanDowncast<T>,
    T: ObjectType

Tries to downcast to a reference of its subclass or interface implementor T. Read more

fn dynamic_cast<T>(self) -> Result<T, Self> where
    T: ObjectType

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

fn dynamic_cast_ref<T>(&self) -> Option<&T> where
    T: ObjectType

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

unsafe fn unsafe_cast<T>(self) -> T where
    T: ObjectType

Casts to T unconditionally. Read more

unsafe fn unsafe_cast_ref<T>(&self) -> &T where
    T: ObjectType

Casts to &T unconditionally. Read more

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> ObjectExt for T where
    T: ObjectType

impl<T> ToValue for T where
    T: SetValue + ?Sized