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

pub trait Node: Element {
    fn detach(&mut self) -> Self { ... }
fn reparent<E1, E2>(
        &mut self,
        new_parent: E1,
        ref_child: E2
    ) -> Result<Self, Self>
    where
        E1: Container,
        E2: Node
, { ... }
fn parent(&self) -> Option<Handle> { ... }
fn brother(&self) -> Option<Handle> { ... }
fn dialog(&self) -> Option<Handle> { ... }
fn dialog_child<S: Into<String>>(&self, name: S) -> Option<Handle> { ... }
fn refresh(&mut self) { ... }
fn refresh_children(&mut self) { ... }
fn update(&self) { ... }
fn update_children(&self) { ... }
fn redraw(&self, also_redraw_children: bool) { ... } }

Nodes are elements that can be part of a hierarchical structure.

Provided Methods

Detaches an interface element from its parent.

It will automatically call Widget::unmap to unmap the element if necessary, and then detach the element.

If left detached it is still necessary to call Element::destroy to destroy the detached element.

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

Moves an interface element from one position in the hierarchy tree to another.

TODO ref_child NULL doc. See #23.

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

Returns the parent of a element.

Returns the brother of an element.

Returns the handle of the dialog that contains that interface element.

Works also for children of a menu that is associated with a dialog.

Returns the identifier of the child element that has the NAME attribute equals to the given value on the same dialog hierarchy.

Works also for children of a menu that is associated with a dialog.

This function will only found the child if the NAME attribute is set at the control.

The function returns immediatelly with the result (not needing to traverse the hierarchy) after the child is mapped.

Updates the size and layout of all controls in the same dialog.

Can be called even if the dialog is not mapped. Can be used for any control, but it will always affect the whole dialog, to refresh the layout of only a subset of the dialog use Node::refresh_children.

This function will not change the size of the dialog, except if the SIZE or RASTERSIZE attributes of the dialog where changed before the call. Changing the size of elements without changing the dialog size may position some controls outside the dialog area at the left or bottom borders (the elements will be cropped at the dialog borders by the native system).

Widget::map also updates the dialog layout, but only when called for the dialog itself, even if the dialog is already mapped. Since Widget::show, DialogElement::showxy and DialogElement::popup call Widget::map, then they all will always update the dialog layout before showing it, even also if the dialog is already visible.

Updates the size and layout of controls after changing size attributes, or attributes that affect the size of the control.

Can be used for any element inside a dialog, only its children will be updated.

The given element must be a container. It must be inside a dialog hierarchy and must be mapped. It can not be a dialog. For dialogs use Node::refresh.

This function will not change the size of the given element, even if the natural size of its children would increase its natural size.

Mark the element to be redraw when the control returns to the system.

Mark the element children to be redraw when the control returns to the system.

Force the element and its children to be redraw immediately.

Implementors