Struct WindowHandler

Source
pub struct WindowHandler { /* private fields */ }

Implementations§

Source§

impl WindowHandler

Source

pub fn new<W: Widget + 'static>(widget: W) -> Self

Source

pub fn schedule_update(&mut self)

Will schedule an update for the next frame.

Trait Implementations§

Source§

impl AppHandler for WindowHandler

Source§

fn command(&mut self, id: u32)

Called when a menu item is selected.
Source§

impl FruiWindowHandler for WindowHandler

Source§

fn connect(&mut self, handle: &WindowHandle)

Source§

fn prepare_paint(&mut self)

Source§

fn paint(&mut self, piet: &mut PaintContext<'_>, _invalid: &Region)

Source§

fn size(&mut self, size: Size)

Source§

fn idle(&mut self, _token: IdleToken)

Source§

fn destroy(&mut self)

Source§

fn as_any(&mut self) -> &mut dyn Any

Source§

fn mouse_down(&mut self, event: &MouseEvent)

Source§

fn mouse_move(&mut self, event: &MouseEvent)

Source§

fn mouse_up(&mut self, event: &MouseEvent)

Source§

fn wheel(&mut self, event: &MouseEvent)

Source§

fn key_down(&mut self, event: KeyEvent) -> bool

Source§

impl WinHandler for WindowHandler

Source§

fn connect(&mut self, handle: &WindowHandle)

Provide the handler with a handle to the window so that it can invalidate or make other requests. Read more
Source§

fn prepare_paint(&mut self)

Request the handler to prepare to paint the window contents. In particular, if there are any regions that need to be repainted on the next call to paint, the handler should invalidate those regions by calling WindowHandle::invalidate_rect or WindowHandle::invalidate.
Source§

fn paint(&mut self, piet: &mut Piet<'_>, invalid: &Region)

Request the handler to paint the window contents. invalid is the region in display points that needs to be repainted; painting outside the invalid region will have no effect.
Source§

fn as_any(&mut self) -> &mut dyn Any

Get a reference to the handler state. Used mostly by idle handlers.
Source§

fn size(&mut self, size: Size)

Called when the size of the window has changed. Read more
Source§

fn idle(&mut self, token: IdleToken)

Called when a idle token is requested by IdleHandle::schedule_idle() call.
Source§

fn destroy(&mut self)

Called when the window is being destroyed. Note that this happens earlier in the sequence than drop (at WM_DESTROY, while the latter is WM_NCDESTROY).
Source§

fn mouse_down(&mut self, event: &MouseEvent)

Called on mouse button down.
Source§

fn mouse_move(&mut self, event: &MouseEvent)

Called when the mouse moves.
Source§

fn mouse_up(&mut self, event: &MouseEvent)

Called on mouse button up.
Source§

fn wheel(&mut self, event: &MouseEvent)

Called on a mouse wheel event. Read more
Source§

fn key_down(&mut self, event: KeyEvent) -> bool

Called on a key down event. Read more
Source§

fn scale(&mut self, scale: Scale)

Called when the scale of the window has changed. Read more
Source§

fn rebuild_resources(&mut self)

Called when the resources need to be rebuilt. Read more
Source§

fn command(&mut self, id: u32)

Called when a menu item is selected.
Source§

fn save_as(&mut self, token: FileDialogToken, file: Option<FileInfo>)

Called when a “Save As” dialog is closed. Read more
Source§

fn open_file(&mut self, token: FileDialogToken, file: Option<FileInfo>)

Called when an “Open” dialog is closed. Read more
Source§

fn key_up(&mut self, event: KeyEvent)

Called when a key is released. This corresponds to the WM_KEYUP message on Windows, or keyUp(withEvent:) on macOS.
Source§

fn zoom(&mut self, delta: f64)

Called when a platform-defined zoom gesture occurs (such as pinching on the trackpad).
Source§

fn mouse_leave(&mut self)

Called when the mouse cursor has left the application window
Source§

fn timer(&mut self, token: TimerToken)

Called on timer event. Read more
Source§

fn got_focus(&mut self)

Called when this window becomes the focused window.
Source§

fn lost_focus(&mut self)

Called when this window stops being the focused window.
Source§

fn request_close(&mut self)

Called when the shell requests to close the window, for example because the user clicked the little “X” in the titlebar. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheapEq for T
where T: ?Sized,

Source§

const CHEAP_TO_EQ: bool = false

This associated type is used to avoid recursive comparisons of the whole widget subtree (if one of the fields is itself a widget).
Source§

default fn cheap_eq(&self, _: &T) -> bool

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WidgetDebug for T

Source§

default fn debug_name(&self) -> &'static str

Source§

fn debug_name_short(&self) -> &'static str

Source§

impl<T> WidgetLocalKey for T

Source§

default fn local_key(&self) -> Option<LocalKeyAny<'_>>

Source§

impl<T> WidgetUniqueType for T

Source§

default fn unique_type(&self) -> TypeId