pub struct Dialogs(/* private fields */);Expand description
The queue of dialogs.
Implementations§
Source§impl Dialogs
impl Dialogs
Sourcepub fn open(&self, dialog: impl Into<DialogSpec>) -> u64
pub fn open(&self, dialog: impl Into<DialogSpec>) -> u64
Queues a dialog (or a DialogSpec); returns its id.
Sourcepub fn open_custom(
&self,
app: &AppHandle,
spec: impl Into<DialogSpec>,
body: impl FnMut(&mut Ui, &AppHandle, &mut CustomPass) + 'static,
) -> Result<u64, String>
pub fn open_custom( &self, app: &AppHandle, spec: impl Into<DialogSpec>, body: impl FnMut(&mut Ui, &AppHandle, &mut CustomPass) + 'static, ) -> Result<u64, String>
Queues a dialog with a body of its own (Custom): the body is
kept on the application’s side and drawn every frame the dialog
is shown. When the dialog says what its body needs
(Custom::needs), the need is checked against the custom
dialog’s offer first: a refusal is reported with its rule and
opens nothing (ADR 0003, ADR 0013).
Sourcepub fn current(&self) -> Option<(u64, Dialog)>
pub fn current(&self) -> Option<(u64, Dialog)>
The dialog shown in the current window group (see the module’s documentation), with its id.
Sourcepub fn current_in(&self, group: ViewportId) -> Option<(u64, Dialog)>
pub fn current_in(&self, group: ViewportId) -> Option<(u64, Dialog)>
The dialog shown in a window group (AppHandle::window_group), with
its id.
Sourcepub fn offset(&self) -> Option<Vec2>
pub fn offset(&self) -> Option<Vec2>
Where the dialog shown is: its offset from the window’s centre, in points (zero: centred).
pub fn is_empty(&self) -> bool
Sourcepub fn answer(&self, answer: Answer, origin: Origin) -> Result<(), String>
pub fn answer(&self, answer: Answer, origin: Origin) -> Result<(), String>
Answers the shown dialog (applied on the next frame), as origin.
Sourcepub fn cancel(&self, id: u64, origin: Origin) -> bool
pub fn cancel(&self, id: u64, origin: Origin) -> bool
Cancels a dialog by its id, shown or waiting (applied on the next
frame, through the STEP_ANSWER step, as origin): what opened
it no longer wants an answer, its question expired. Returns
whether it was open.
Sourcepub fn describe(&self) -> Json
pub fn describe(&self) -> Json
The dialog shown in the current window group and how many wait behind it, as the bridge shows them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dialogs
impl RefUnwindSafe for Dialogs
impl Send for Dialogs
impl Sync for Dialogs
impl Unpin for Dialogs
impl UnsafeUnpin for Dialogs
impl UnwindSafe for Dialogs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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