pub struct Shell<'a, Message> { /* private fields */ }
Expand description
Implementations§
Source§impl<'a, Message> Shell<'a, Message>
impl<'a, Message> Shell<'a, Message>
Sourcepub fn new(messages: &'a mut Vec<Message>) -> Self
pub fn new(messages: &'a mut Vec<Message>) -> Self
Creates a new Shell
with the provided buffer of messages.
Sourcepub fn publish(&mut self, message: Message)
pub fn publish(&mut self, message: Message)
Publish the given Message
for an application to process it.
Sourcepub fn capture_event(&mut self)
pub fn capture_event(&mut self)
Marks the current event as captured. Prevents “event bubbling”.
A widget should capture an event when no ancestor should handle it.
Sourcepub fn event_status(&self) -> Status
pub fn event_status(&self) -> Status
Returns the current event::Status
of the Shell
.
Sourcepub fn is_event_captured(&self) -> bool
pub fn is_event_captured(&self) -> bool
Returns whether the current event has been captured.
Sourcepub fn request_redraw(&mut self)
pub fn request_redraw(&mut self)
Requests a new frame to be drawn as soon as possible.
Sourcepub fn request_redraw_at(&mut self, redraw_request: impl Into<RedrawRequest>)
pub fn request_redraw_at(&mut self, redraw_request: impl Into<RedrawRequest>)
Requests a new frame to be drawn at the given window::RedrawRequest
.
Sourcepub fn redraw_request(&self) -> RedrawRequest
pub fn redraw_request(&self) -> RedrawRequest
Returns the request a redraw should happen, if any.
Sourcepub fn replace_redraw_request(shell: &mut Self, redraw_request: RedrawRequest)
pub fn replace_redraw_request(shell: &mut Self, redraw_request: RedrawRequest)
Replaces the redraw request of the Shell
; without conflict resolution.
This is useful if you want to overwrite the redraw request to a previous value. Since it’s a fairly advanced use case and should rarely be used, it is a static method.
Sourcepub fn request_input_method<T: AsRef<str>>(&mut self, ime: &InputMethod<T>)
pub fn request_input_method<T: AsRef<str>>(&mut self, ime: &InputMethod<T>)
Requests the current InputMethod
strategy.
Important: This request will only be honored by the
Shell
only during a window::Event::RedrawRequested
.
Sourcepub fn input_method(&self) -> &InputMethod
pub fn input_method(&self) -> &InputMethod
Returns the current InputMethod
strategy.
Sourcepub fn input_method_mut(&mut self) -> &mut InputMethod
pub fn input_method_mut(&mut self) -> &mut InputMethod
Returns the current InputMethod
strategy.
Sourcepub fn is_layout_invalid(&self) -> bool
pub fn is_layout_invalid(&self) -> bool
Returns whether the current layout is invalid or not.
Sourcepub fn invalidate_layout(&mut self)
pub fn invalidate_layout(&mut self)
Invalidates the current application layout.
The shell will relayout the application widgets.
Sourcepub fn revalidate_layout(&mut self, f: impl FnOnce())
pub fn revalidate_layout(&mut self, f: impl FnOnce())
Triggers the given function if the layout is invalid, cleaning it in the process.
Sourcepub fn are_widgets_invalid(&self) -> bool
pub fn are_widgets_invalid(&self) -> bool
Returns whether the widgets of the current application have been invalidated.
Sourcepub fn invalidate_widgets(&mut self)
pub fn invalidate_widgets(&mut self)
Invalidates the current application widgets.
The shell will rebuild and relayout the widget tree.