pub struct WindowHandler { /* private fields */ }Implementations
sourceimpl WindowHandler
impl WindowHandler
pub fn new<W>(widget: W) -> WindowHandlerwhere
W: 'static + Widget,
sourcepub fn schedule_update(&mut self)
pub fn schedule_update(&mut self)
Will schedule an update for the next frame.
Trait Implementations
sourceimpl AppHandler for WindowHandler
impl AppHandler for WindowHandler
sourceimpl FruiWindowHandler for WindowHandler
impl FruiWindowHandler for WindowHandler
fn connect(&mut self, handle: &WindowHandle)
fn prepare_paint(&mut self)
fn paint(&mut self, piet: &mut CairoRenderContext<'_>, _invalid: &Region)
fn size(&mut self, size: Size)
fn idle(&mut self, _token: IdleToken)
fn destroy(&mut self)
fn as_any(&mut self) -> &mut (dyn Any + 'static)
fn mouse_down(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
fn mouse_up(&mut self, event: &MouseEvent)
fn wheel(&mut self, event: &MouseEvent)
fn key_down(&mut self, event: KeyEvent) -> bool
sourceimpl WinHandler for WindowHandler
impl WinHandler for WindowHandler
sourcefn connect(&mut self, handle: &WindowHandle)
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
sourcefn prepare_paint(&mut self)
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. Read moresourcefn paint(&mut self, piet: &mut CairoRenderContext<'_>, invalid: &Region)
fn paint(&mut self, piet: &mut CairoRenderContext<'_>, 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. Read moresourcefn as_any(&mut self) -> &mut (dyn Any + 'static)
fn as_any(&mut self) -> &mut (dyn Any + 'static)
Get a reference to the handler state. Used mostly by idle handlers.
sourcefn idle(&mut self, token: IdleToken)
fn idle(&mut self, token: IdleToken)
Called when a idle token is requested by
IdleHandle::schedule_idle() call.sourcefn destroy(&mut self)
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). Read more
sourcefn mouse_down(&mut self, event: &MouseEvent)
fn mouse_down(&mut self, event: &MouseEvent)
Called on mouse button down.
sourcefn mouse_move(&mut self, event: &MouseEvent)
fn mouse_move(&mut self, event: &MouseEvent)
Called when the mouse moves.
sourcefn mouse_up(&mut self, event: &MouseEvent)
fn mouse_up(&mut self, event: &MouseEvent)
Called on mouse button up.
sourcefn wheel(&mut self, event: &MouseEvent)
fn wheel(&mut self, event: &MouseEvent)
Called on a mouse wheel event. Read more
fn rebuild_resources(&mut self)
fn rebuild_resources(&mut self)
Called when the resources need to be rebuilt. Read more
fn save_as(&mut self, token: FileDialogToken, file: Option<FileInfo>)
fn save_as(&mut self, token: FileDialogToken, file: Option<FileInfo>)
Called when a “Save As” dialog is closed. Read more
fn open_file(&mut self, token: FileDialogToken, file: Option<FileInfo>)
fn open_file(&mut self, token: FileDialogToken, file: Option<FileInfo>)
Called when an “Open” dialog is closed. Read more
fn key_up(&mut self, event: KeyEvent)
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. Read more
fn zoom(&mut self, delta: f64)
fn zoom(&mut self, delta: f64)
Called when a platform-defined zoom gesture occurs (such as pinching
on the trackpad). Read more
fn mouse_leave(&mut self)
fn mouse_leave(&mut self)
Called when the mouse cursor has left the application window
fn timer(&mut self, token: TimerToken)
fn timer(&mut self, token: TimerToken)
Called on timer event. Read more
fn got_focus(&mut self)
fn got_focus(&mut self)
Called when this window becomes the focused window.
fn lost_focus(&mut self)
fn lost_focus(&mut self)
Called when this window stops being the focused window.
fn request_close(&mut self)
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
impl !Immutable for WindowHandler
impl !RefUnwindSafe for WindowHandler
impl !Send for WindowHandler
impl !Sync for WindowHandler
impl Unpin for WindowHandler
impl !UnwindSafe for WindowHandler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more