pub struct WindowCtx(/* private fields */);Expand description
Defines the backing data of WINDOW.
Each window owns this data and calls WINDOW.with_context to delegate to it’s child node.
Implementations§
Source§impl WindowCtx
impl WindowCtx
Sourcepub fn new(id: WindowId, mode: WindowMode) -> Self
pub fn new(id: WindowId, mode: WindowMode) -> Self
New window context.
Sourcepub fn set_widget_tree(&mut self, widget_tree: WidgetInfoTree)
pub fn set_widget_tree(&mut self, widget_tree: WidgetInfoTree)
Sets the widget tree, must be called after every info update.
Window contexts are partially available in the window new closure, but values like the widget_tree is
available on init, so a WidgetInfoTree::wgt must be set as soon as the window and widget ID are available.
Sourcepub fn mode(&self) -> WindowMode
pub fn mode(&self) -> WindowMode
Gets the window mode.
Sourcepub fn widget_tree(&self) -> WidgetInfoTree
pub fn widget_tree(&self) -> WidgetInfoTree
Gets the window tree.
Sourcepub fn with_state<R>(
&mut self,
f: impl FnOnce(&mut OwnedStateMap<WINDOW>) -> R,
) -> R
pub fn with_state<R>( &mut self, f: impl FnOnce(&mut OwnedStateMap<WINDOW>) -> R, ) -> R
Call f with an exclusive lock to the window state.
Clone a reference to the window context.
This must be used only if the window implementation is split.
Auto Trait Implementations§
impl Freeze for WindowCtx
impl !RefUnwindSafe for WindowCtx
impl Send for WindowCtx
impl Sync for WindowCtx
impl Unpin for WindowCtx
impl !UnwindSafe for WindowCtx
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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