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§
Source§impl<'ui, 'p, Label> PopupModal<'ui, 'p, Label>
impl<'ui, 'p, Label> PopupModal<'ui, 'p, Label>
pub fn new(ui: &'ui Ui, label: Label) -> PopupModal<'ui, 'p, Label>
👎Deprecated since 0.9.0: Use
ui.modal_popup_config(...)
insteadSourcepub fn opened(self, opened: &'p mut bool) -> PopupModal<'ui, 'p, Label>
pub fn opened(self, opened: &'p mut bool) -> PopupModal<'ui, 'p, Label>
Pass a mutable boolean which will be updated to refer to the current “open” state of the modal.
pub fn flags(self, flags: WindowFlags) -> PopupModal<'ui, 'p, Label>
pub fn title_bar(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn resizable(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn movable(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn scroll_bar(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn scrollable(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn collapsible(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn always_auto_resize(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn save_settings(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn inputs(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn horizontal_scrollbar(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn no_focus_on_appearing(self, value: bool) -> PopupModal<'ui, 'p, Label>
pub fn no_bring_to_front_on_focus( self, value: bool, ) -> PopupModal<'ui, 'p, Label>
pub fn always_vertical_scrollbar( self, value: bool, ) -> PopupModal<'ui, 'p, Label>
pub fn always_horizontal_scrollbar( self, value: bool, ) -> PopupModal<'ui, 'p, Label>
pub fn always_use_window_padding( self, value: bool, ) -> PopupModal<'ui, 'p, Label>
Sourcepub fn build<T, F>(self, f: F) -> Option<T>where
F: FnOnce() -> T,
pub fn build<T, F>(self, f: F) -> Option<T>where
F: FnOnce() -> T,
Consume and draw the PopupModal. Returns the result of the closure, if it is called.
Sourcepub fn begin_popup(self) -> Option<PopupToken<'ui>>
pub fn begin_popup(self) -> Option<PopupToken<'ui>>
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§
impl<'ui, 'p, Label> Freeze for PopupModal<'ui, 'p, Label>where
Label: Freeze,
impl<'ui, 'p, Label> !RefUnwindSafe for PopupModal<'ui, 'p, Label>
impl<'ui, 'p, Label> !Send for PopupModal<'ui, 'p, Label>
impl<'ui, 'p, Label> !Sync for PopupModal<'ui, 'p, Label>
impl<'ui, 'p, Label> Unpin for PopupModal<'ui, 'p, Label>where
Label: Unpin,
impl<'ui, 'p, Label> !UnwindSafe for PopupModal<'ui, 'p, Label>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more