Trait dui::element::hierarchy::Container [] [src]

pub trait Container: Node {
    fn append<E: Node>(&mut self, new_child: E) -> Result<Handle, E> { ... }
fn insert<E1, E2>(
        &mut self,
        ref_child: &E1,
        new_child: E2
    ) -> Result<Handle, E2>
    where
        E1: Node,
        E2: Node
, { ... }
fn child(&self, pos: usize) -> Option<Handle> { ... }
fn child_pos<E: Node>(&self, child: &E) -> Option<usize> { ... }
fn child_count(&self) -> usize { ... } }

Containers are elements that can store childs.

Provided Methods

Inserts an interface element at the end of the container, after the last element on it.

This function can be used when elements that will compose a container are not known a priori and should be dynamically constructed.

Valid for any element that contains other elements like dialog, frame, hbox, vbox, zbox or menu.

The new_child can not be mapped. It will not map the new_child into the native system. If the parent is already mapped you must explicitly call Widget::map for the new child.

The elements are not immediately repositioned. Call Node::refresh for the container (or any other element in the dialog) to update the dialog layout.

If the actual parent is a layout box (VBox, HBox or ZBox) and you try to append a child that it is already at the parent child list, then the child is moved to the last child position.

Returns the actual parent if the interface element was successfully inserted. Otherwise returns the desired new_child. Failed can happen for instance if this element is not a container for other elements or the new_child is already a child (except on layout boxes). Notice that the desired parent can contains a set of elements and containers where the child will be actually attached so the function returns the actual parent of the element.

Inserts an interface element before another child of the container.

TODO ref_child NULL doc. See #23.

See Container::append for more details on the semantics of this method.

Returns the a child of the element given its position.

The position pos starts from 0.

This function will return the children of the element in the exact same order in which they were assigned.

Returns the position of a child of the given control.

See Container::child for additional details on the semantics of child positions.

Returns the number of children of the given element.

Implementors