Trait droom_ui::dialog::DialogElement [] [src]

pub trait DialogElement: Element + Widget + Container {
    fn showxy(&mut self, x: DialogPos, y: DialogPos) -> Result<(), String> { ... }
    fn popup(&mut self, x: DialogPos, y: DialogPos) -> Result<Self, Self> { ... }
}

Provided Methods

Displays a dialog in a given position on the screen.

Will call Widget::map for the element.

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.

Panics

Panics if x is either Bottom or Top or if y is either Left or Right.

Shows a dialog or menu and restricts user interaction only to the specified element.

It is equivalent of creating a modal dialog is some toolkits.

If another dialog is shown after popup using show, then its interaction will not be inhibited. Every popup call creates a new popup level that inhibits all previous dialogs interactions, but does not disable new ones. IMPORTANT: The popup levels must be closed in the reverse order they were created or unpredictable results will occur.

For a dialog this function will only return the control to the application after a callback returns CallbackReturn::Close, IupExitLoop (TODO) is called, or when the popup dialog is hidden, for example using Widget::hide. For a menu it returns automatically after a menu item is selected. IMPORTANT: If a menu item callback returns CallbackReturn::Close, it will ends the current popup level dialog.

Panics

Panics if x is either Bottom or Top or if y is either Left or Right.

Implementors