Struct imgui::PopupModal [−][src]
pub struct PopupModal<'p, Label> { /* fields omitted */ }
Expand description
Create a modal pop-up.
Example
if ui.button(im_str!("Show modal")) {
ui.open_popup(im_str!("modal"));
}
if let Some(_token) = PopupModal::new(im_str!("modal")).begin_popup(&ui) {
ui.text("Content of my modal");
if ui.button(im_str!("OK")) {
ui.close_current_popup();
}
};
Implementations
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.