pub struct KeyWidgetDeclarer<V: 'static> { /* private fields */ }Implementations§
Source§impl<V: 'static> KeyWidgetDeclarer<V>
impl<V: 'static> KeyWidgetDeclarer<V>
Source§impl<V: 'static> KeyWidgetDeclarer<V>
impl<V: 'static> KeyWidgetDeclarer<V>
Sourcepub fn tab_index<_M, _V>(self, v: _V) -> Self
pub fn tab_index<_M, _V>(self, v: _V) -> Self
Initializes the widget with a tab index. The tab index is used to allow or prevent widgets from being sequentially focusable(usually with the Tab key, hence the name) and determine their relative ordering for sequential focus navigation
Sourcepub fn auto_focus<_M, _V>(self, v: _V) -> Self
pub fn auto_focus<_M, _V>(self, v: _V) -> Self
Initializes whether the widget should automatically get focus when the window loads.
Sourcepub fn on_event(self, f: impl FnMut(&mut Event) + 'static) -> Self
pub fn on_event(self, f: impl FnMut(&mut Event) + 'static) -> Self
Attaches an event handler to the widget. It’s triggered when any event or lifecycle change happens.
Sourcepub fn on_mounted(self, f: impl FnOnce(&mut LifecycleEvent) + 'static) -> Self
pub fn on_mounted(self, f: impl FnOnce(&mut LifecycleEvent) + 'static) -> Self
Attaches an event handler that runs when the widget is first mounted to the tree
Sourcepub fn on_performed_layout(
self,
f: impl FnMut(&mut LifecycleEvent) + 'static,
) -> Self
pub fn on_performed_layout( self, f: impl FnMut(&mut LifecycleEvent) + 'static, ) -> Self
Attaches an event handler that runs after the widget is performed layout.
Sourcepub fn on_disposed(self, f: impl FnOnce(&mut LifecycleEvent) + 'static) -> Self
pub fn on_disposed(self, f: impl FnOnce(&mut LifecycleEvent) + 'static) -> Self
Attaches an event handler that runs when the widget is disposed.
Sourcepub fn on_pointer_down(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_pointer_down(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a pointer down occurs.
Sourcepub fn on_pointer_down_capture(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_down_capture( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a pointer down event. This is similar to on_pointer_down, but it’s triggered earlier in the event flow.
Sourcepub fn on_pointer_up(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_pointer_up(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a pointer up occurs.
Sourcepub fn on_pointer_up_capture(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_up_capture( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a pointer up event. This is similar to on_pointer_up, but it’s triggered earlier in the event flow.
Sourcepub fn on_pointer_move(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_pointer_move(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a pointer move occurs.
Sourcepub fn on_pointer_move_capture(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_move_capture( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a pointer move event. This is similar to on_pointer_move, but it’s triggered earlier in the event flow.
Sourcepub fn on_pointer_cancel(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_cancel( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered when a pointer event cancels.
Sourcepub fn on_pointer_enter(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_enter( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered when a pointer device is moved into the hit test boundaries of an widget or one of its descendants
Sourcepub fn on_pointer_leave(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_pointer_leave( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered when a pointer device is moved out of the hit test boundaries of an widget or one of its descendants.
Sourcepub fn on_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a tap(click) occurs.
Sourcepub fn on_tap_capture(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_tap_capture(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered during the capture
phase of a tap event. This is similar to on_tap, but it’s triggered
earlier in the event flow.
Sourcepub fn on_double_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_double_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a double tap occurs.
Sourcepub fn on_double_tap_capture(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_double_tap_capture( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a double tap event. This is similar to on_double_tap, but it’s triggered earlier in the event flow.
Sourcepub fn on_triple_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
pub fn on_triple_tap(self, f: impl FnMut(&mut PointerEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when a triple tap occurs.
Sourcepub fn on_triple_tap_capture(
self,
f: impl FnMut(&mut PointerEvent) + 'static,
) -> Self
pub fn on_triple_tap_capture( self, f: impl FnMut(&mut PointerEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a triple tap event. This is similar to on_triple_tap, but it’s triggered earlier in the event flow.
Sourcepub fn on_x_times_tap(
self,
f: (usize, impl FnMut(&mut PointerEvent) + 'static),
) -> Self
pub fn on_x_times_tap( self, f: (usize, impl FnMut(&mut PointerEvent) + 'static), ) -> Self
Attaches a handler to the widget that is triggered when a x-times tap occurs.
Sourcepub fn on_x_times_tap_capture(
self,
f: (usize, impl FnMut(&mut PointerEvent) + 'static),
) -> Self
pub fn on_x_times_tap_capture( self, f: (usize, impl FnMut(&mut PointerEvent) + 'static), ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a x-times tap event. This is similar to on_x_times_tap, but it’s triggered earlier in the event flow.
Sourcepub fn on_wheel(self, f: impl FnMut(&mut WheelEvent) + 'static) -> Self
pub fn on_wheel(self, f: impl FnMut(&mut WheelEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the user rotates a wheel button on a pointing device (typically a mouse).
Sourcepub fn on_wheel_capture(self, f: impl FnMut(&mut WheelEvent) + 'static) -> Self
pub fn on_wheel_capture(self, f: impl FnMut(&mut WheelEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a wheel event. This is similar to on_wheel, but it’s triggered earlier in the event flow.
Sourcepub fn on_ime_pre_edit(
self,
f: impl FnMut(&mut ImePreEditEvent) + 'static,
) -> Self
pub fn on_ime_pre_edit( self, f: impl FnMut(&mut ImePreEditEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered when the input method pre-edit area is changed.
Sourcepub fn on_ime_pre_edit_capture(
self,
f: impl FnMut(&mut ImePreEditEvent) + 'static,
) -> Self
pub fn on_ime_pre_edit_capture( self, f: impl FnMut(&mut ImePreEditEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a input method pre-edit event. This is similar to on_ime_pre_edit, but it’s triggered earlier in the event flow.
Sourcepub fn on_chars(self, f: impl FnMut(&mut CharsEvent) + 'static) -> Self
pub fn on_chars(self, f: impl FnMut(&mut CharsEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the input method commits text or keyboard pressed the text key
Sourcepub fn on_chars_capture(self, f: impl FnMut(&mut CharsEvent) + 'static) -> Self
pub fn on_chars_capture(self, f: impl FnMut(&mut CharsEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a input method commit event. This is similar to on_chars, but it’s triggered earlier in the event flow.
Sourcepub fn on_key_down(self, f: impl FnMut(&mut KeyboardEvent) + 'static) -> Self
pub fn on_key_down(self, f: impl FnMut(&mut KeyboardEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the keyboard key is pressed.
Sourcepub fn on_key_down_capture(
self,
f: impl FnMut(&mut KeyboardEvent) + 'static,
) -> Self
pub fn on_key_down_capture( self, f: impl FnMut(&mut KeyboardEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a key down event. This is similar to on_key_down, but it’s triggered earlier in the event flow.
Sourcepub fn on_key_up(self, f: impl FnMut(&mut KeyboardEvent) + 'static) -> Self
pub fn on_key_up(self, f: impl FnMut(&mut KeyboardEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the keyboard key is released.
Sourcepub fn on_key_up_capture(
self,
f: impl FnMut(&mut KeyboardEvent) + 'static,
) -> Self
pub fn on_key_up_capture( self, f: impl FnMut(&mut KeyboardEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a key up event. This is similar to on_key_up, but it’s triggered earlier in the event flow.
Sourcepub fn on_focus(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
pub fn on_focus(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the widget is focused.
Sourcepub fn on_blur(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
pub fn on_blur(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the widget is lost focus.
Sourcepub fn on_focus_in(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
pub fn on_focus_in(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the widget or its descendants are focused. The main difference between this event and focus is that focusin bubbles while focus does not.
Sourcepub fn on_focus_in_capture(
self,
f: impl FnMut(&mut FocusEvent) + 'static,
) -> Self
pub fn on_focus_in_capture( self, f: impl FnMut(&mut FocusEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a focus in event. This is similar to on_focus_in, but it’s triggered earlier in the event flow.
Sourcepub fn on_focus_out(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
pub fn on_focus_out(self, f: impl FnMut(&mut FocusEvent) + 'static) -> Self
Attaches a handler to the widget that is triggered when the widgetor its descendants are lost focus. The main difference between this event and focusout is that focusout bubbles while blur does not
Sourcepub fn on_focus_out_capture(
self,
f: impl FnMut(&mut FocusEvent) + 'static,
) -> Self
pub fn on_focus_out_capture( self, f: impl FnMut(&mut FocusEvent) + 'static, ) -> Self
Attaches a handler to the widget that is triggered during the capture phase of a focus out event. This is similar to on_focus_out, but it’s triggered earlier in the event flow.
Sourcepub fn box_fit<_M, _V>(self, v: _V) -> Self
pub fn box_fit<_M, _V>(self, v: _V) -> Self
Initializes how its child should be scale to fit its box.
Sourcepub fn background<_M, _V>(self, v: _V) -> Self
pub fn background<_M, _V>(self, v: _V) -> Self
Initializes the background of the widget.
Sourcepub fn border_radius<_M, _V>(self, v: _V) -> Self
pub fn border_radius<_M, _V>(self, v: _V) -> Self
Initializes the border radius of the widget.
Sourcepub fn scrollable<_M, _V>(self, v: _V) -> Self
pub fn scrollable<_M, _V>(self, v: _V) -> Self
Initializes how user can scroll the widget.
Sourcepub fn scroll_pos<_M, _V>(self, v: _V) -> Self
pub fn scroll_pos<_M, _V>(self, v: _V) -> Self
Initializes the scroll position of the widget.
Sourcepub fn h_align<_M, _V>(self, v: _V) -> Self
pub fn h_align<_M, _V>(self, v: _V) -> Self
Initializes how the widget should be aligned horizontally.
Sourcepub fn v_align<_M, _V>(self, v: _V) -> Self
pub fn v_align<_M, _V>(self, v: _V) -> Self
Initializes how the widget should be aligned vertically.
Sourcepub fn anchor<_M, _V>(self, v: _V) -> Self
pub fn anchor<_M, _V>(self, v: _V) -> Self
Initializes the relative anchor to the parent of the widget
Sourcepub fn global_anchor<_M, _V>(self, v: _V) -> Self
pub fn global_anchor<_M, _V>(self, v: _V) -> Self
Initializes the global anchor of the widget.
Sourcepub fn keep_alive<_M, _V>(self, v: _V) -> Self
pub fn keep_alive<_M, _V>(self, v: _V) -> Self
Initializes the keep_alive value of the KeepAlive widget.
Trait Implementations§
Auto Trait Implementations§
impl<V> !Freeze for KeyWidgetDeclarer<V>
impl<V> !RefUnwindSafe for KeyWidgetDeclarer<V>
impl<V> !Send for KeyWidgetDeclarer<V>
impl<V> !Sync for KeyWidgetDeclarer<V>
impl<V> !UnwindSafe for KeyWidgetDeclarer<V>
impl<V> Unpin for KeyWidgetDeclarer<V>where
V: Unpin,
impl<V> UnsafeUnpin for KeyWidgetDeclarer<V>where
V: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.