[]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 Clone for Box

impl Debug for Box

impl Display for Box[src]

impl Eq for Box

impl Hash for Box

impl IsA<Box> for AppChooserWidget

impl IsA<Box> for ButtonBox

impl IsA<Box> for Statusbar

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 ShortcutLabel

impl IsA<Box> for StackSwitcher

impl IsA<Buildable> for Box

impl IsA<Container> for Box

impl IsA<Orientable> for Box

impl IsA<Widget> for Box

impl Ord for Box

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

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

impl StaticType for Box

Auto Trait Implementations

impl RefUnwindSafe for Box

impl !Send for Box

impl !Sync for Box

impl Unpin for Box

impl UnwindSafe for Box

Blanket Implementations

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

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

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

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

impl<T> Cast for T where
    T: ObjectType, 

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

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

impl<T> ObjectExt for T where
    T: ObjectType, 

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 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<'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<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> ToValue for T where
    T: SetValue + ?Sized

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

type Error = !

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.