Struct imgui::PopupModal

source ·
pub struct PopupModal<'ui, 'p, Label> { /* private fields */ }
Expand description

Create a modal pop-up.

Example

if ui.button("Show modal") {
    ui.open_popup("modal");
}
if let Some(_token) = ui.begin_modal_popup("modal") {
    ui.text("Content of my modal");
    if ui.button("OK") {
        ui.close_current_popup();
    }
};

Implementations§

👎Deprecated since 0.9.0: Use ui.modal_popup_config(...) instead

Pass a mutable boolean which will be updated to refer to the current “open” state of the modal.

Consume and draw the PopupModal. Returns the result of the closure, if it is called.

Consume and draw the PopupModal. Construct a popup that can have any kind of content.

This should be called per frame, whereas Ui::open_popup should be called once when you want to actual create the popup.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.