Trait droom_ui::element::widget::Widget
[−]
[src]
pub trait Widget: Element + Node { fn map(&mut self) -> Result<Self, Self> { ... } fn unmap(&mut self) { ... } fn show(&mut self) -> Result<(), String> { ... } fn hide(&mut self) -> Self { ... } }
Provided Methods
fn map(&mut self) -> Result<Self, Self>
Creates (maps) the native interface objects corresponding to the given IUP interface elements.
It will also called recursively to create the native element of all the children in the element's tree.
The element must be already attached to a mapped container, except the dialog. A child can only be mapped if its parent is already mapped.
This function is automatically called before the dialog is shown in
Widget::show
, DialogElement::showxy
and DialogElement::popup
.
The function returns success if the element is already mapped and if the native creation was successful.
fn unmap(&mut self)
Unmap the element from the native system. It will also unmap all its children.
It will not detach the element from its parent, and it will not destroy the element.
fn show(&mut self) -> Result<(), String>
Shows an interfance element.
Displays a dialog in the current position, or changes a control VISIBLE attribute. If the dialog needs to be mapped and the current position is not known then the dialog is centered.
This function can be executed more than once for the same dialog. This will make the dialog be placed above all other dialogs in the application, changing its Z-order, and update its position and/or size on screen.
The string wrapped in Err
may be meaningless, it is this way so that the returned value
of this call can be passed directly to the closure return of with_iup
.
See also DialogElement::showxy
and DialogElement::popup
.
fn hide(&mut self) -> Self
Hides an interface element.
This function has the same effect as attributing value "NO" to the interface element’s VISIBLE attribute.
Implementors
impl Widget for Handle
impl Widget for Dialog
impl Widget for MessageDlg
impl Widget for FileDlg
impl Widget for VBox
impl Widget for HBox
impl Widget for Radio
impl Widget for Fill
impl Widget for Label
impl Widget for Text
impl Widget for Button
impl Widget for ProgressBar
impl Widget for Toggle
impl Widget for Frame
impl Widget for List