pub struct RootWidget { /* private fields */ }Expand description
The window’s root Widget: a flat fill of its color.
The Engine creates one as Widget 0 for every window. It is the parent of every other
Widget.
Implementations§
Trait Implementations§
Source§impl Widget for RootWidget
impl Widget for RootWidget
Source§fn core(&self) -> &WidgetCore
fn core(&self) -> &WidgetCore
Source§fn core_mut(&mut self) -> &mut WidgetCore
fn core_mut(&mut self) -> &mut WidgetCore
Source§fn paint(&self, p: &mut dyn Painter)
fn paint(&self, p: &mut dyn Painter)
Fills the window with the root Widget’s color.
§Arguments
p- The painter, targeting the rootWidget.
Source§fn handle_event(&mut self, event: &Event, ctx: &mut EventCtx) -> Propagation
fn handle_event(&mut self, event: &Event, ctx: &mut EventCtx) -> Propagation
Handles an event sent to this
Widget. Read moreSource§fn feed_controllers(&mut self, event: &Event, ctx: &mut EventCtx) -> Propagation
fn feed_controllers(&mut self, event: &Event, ctx: &mut EventCtx) -> Propagation
Feeds an event to the
Widget’s controllers and calls
Widget::on_controller_event for each result, in order. Read moreSource§fn on_controller_event(
&mut self,
_event: &ControllerEvent,
_ctx: &mut EventCtx,
) -> Propagation
fn on_controller_event( &mut self, _event: &ControllerEvent, _ctx: &mut EventCtx, ) -> Propagation
Receives a high-level result from one of the
Widget’s controllers. Read moreSource§fn handles_capture(&self) -> bool
fn handles_capture(&self) -> bool
Source§fn event_mask(&self) -> EventMask
fn event_mask(&self) -> EventMask
Returns the classes of events this
Widget wants to receive. Read moreSource§fn get_parent(&self) -> WidgetId
fn get_parent(&self) -> WidgetId
Returns the ID of the
Widget’s parent. Read moreSource§fn get_origin(&self) -> Point
fn get_origin(&self) -> Point
Returns the
Widget’s origin. Read moreSource§fn set_origin(&mut self, point: Point)
fn set_origin(&mut self, point: Point)
Moves the
Widget, and invalidates it. Read moreSource§fn set_size(&mut self, size: Size)
fn set_size(&mut self, size: Size)
Resizes the
Widget, and invalidates it. Its texture is resized on the next repaint. Read moreSource§fn set_color(&mut self, color: Color)
fn set_color(&mut self, color: Color)
Sets the
Widget’s main (background) color, and invalidates it. Read moreReturns whether the
Widget is hidden. Read moreHides or shows the
Widget and all of its children, and invalidates it. Read moreSource§fn set_behavior(&mut self, behavior: Behavior)
fn set_behavior(&mut self, behavior: Behavior)
Replaces the
Widget’s behavior flags, and invalidates it. Read moreSource§fn state(&self) -> VisualState
fn state(&self) -> VisualState
Returns how the
Widget currently looks. Read moreSource§fn set_state(&mut self, state: VisualState)
fn set_state(&mut self, state: VisualState)
Replaces the
Widget’s visual state flags, and invalidates it only if the change can alter
how it looks. Read moreSource§fn appearance(&self) -> &Appearance
fn appearance(&self) -> &Appearance
Returns the
Widget’s per-state appearance. Read moreSource§fn appearance_mut(&mut self) -> &mut Appearance
fn appearance_mut(&mut self) -> &mut Appearance
Source§fn set_style(&mut self, state: VisualState, style: StateStyle)
fn set_style(&mut self, state: VisualState, style: StateStyle)
Sets the style for one visual state, and invalidates the
Widget only if the effective
style for its current state changed. Read moreSource§fn style(&self) -> StateStyle
fn style(&self) -> StateStyle
Returns the effective style for the
Widget’s current state. Read moreSource§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether the
Widget is enabled. Read moreSource§fn set_enabled(&mut self, enabled: bool)
fn set_enabled(&mut self, enabled: bool)
Enables or disables the
Widget, and invalidates it if that changed it. Read moreSource§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Returns whether the
Widget can take keyboard focus. Read moreSource§fn accepts_text_input(&self) -> bool
fn accepts_text_input(&self) -> bool
Returns whether the
Widget is a text editor. Read moreSource§fn is_invalidated(&self) -> bool
fn is_invalidated(&self) -> bool
Returns whether the
Widget needs to be repainted. Read moreSource§fn set_invalidated(&mut self, state: bool)
fn set_invalidated(&mut self, state: bool)
Sets whether the
Widget needs to be repainted. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RootWidget
impl !Send for RootWidget
impl !Sync for RootWidget
impl !UnwindSafe for RootWidget
impl Freeze for RootWidget
impl Unpin for RootWidget
impl UnsafeUnpin for RootWidget
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