Struct show_image::WindowHandle [−][src]
pub struct WindowHandle<'a> { /* fields omitted */ }
Expand description
Handle to a window.
A WindowHandle
can be used to interact with a window from within the global context thread.
To interact with a window from another thread, you need a WindowProxy
.
Implementations
impl<'a> WindowHandle<'a>
[src]
impl<'a> WindowHandle<'a>
[src]pub fn new(context_handle: ContextHandle<'a>, window_id: WindowId) -> Self
[src]
pub fn new(context_handle: ContextHandle<'a>, window_id: WindowId) -> Self
[src]Create a new window handle from a context handle and a window ID.
pub fn proxy(&self) -> WindowProxy
[src]
pub fn proxy(&self) -> WindowProxy
[src]Get a proxy object for the window to interact with it from a different thread.
You should not use proxy objects from withing the global context thread. The proxy objects often wait for the global context to perform some action. Doing so from within the global context thread would cause a deadlock.
pub fn context_handle(&mut self) -> &mut ContextHandle<'a>
[src]
pub fn context_handle(&mut self) -> &mut ContextHandle<'a>
[src]Get the context handle as mutable reference.
pub fn destroy(&mut self) -> Result<(), InvalidWindowId>
[src]
pub fn destroy(&mut self) -> Result<(), InvalidWindowId>
[src]Destroy the window.
Any subsequent operation on the window will return InvalidWindowId
.
pub fn image_info(
&self
) -> Result<Option<(ImageInfo, Rectangle)>, InvalidWindowId>
[src]
pub fn image_info(
&self
) -> Result<Option<(ImageInfo, Rectangle)>, InvalidWindowId>
[src]Get the image info and the area of the window where the image is drawn.
pub fn set_visible(&mut self, visible: bool) -> Result<(), InvalidWindowId>
[src]
pub fn set_visible(&mut self, visible: bool) -> Result<(), InvalidWindowId>
[src]Make the window visible or invisible.
pub fn set_options<F>(&mut self, make_options: F) -> Result<(), InvalidWindowId> where
F: FnOnce(&WindowOptions) -> WindowOptions,
[src]
pub fn set_options<F>(&mut self, make_options: F) -> Result<(), InvalidWindowId> where
F: FnOnce(&WindowOptions) -> WindowOptions,
[src]Change the options of the window.
pub fn set_image(
&mut self,
name: impl Into<String>,
image: &impl AsImageView
) -> Result<(), SetImageError>
[src]
pub fn set_image(
&mut self,
name: impl Into<String>,
image: &impl AsImageView
) -> Result<(), SetImageError>
[src]Set the image to display on the window.
pub fn add_overlay(
&mut self,
name: impl Into<String>,
image: &impl AsImageView
) -> Result<(), SetImageError>
[src]
pub fn add_overlay(
&mut self,
name: impl Into<String>,
image: &impl AsImageView
) -> Result<(), SetImageError>
[src]Add an overlay to the window.
Overlays are drawn on top of the image. Overlays remain active until you call they are cleared.
pub fn clear_overlays(&mut self) -> Result<(), InvalidWindowId>
[src]
pub fn clear_overlays(&mut self) -> Result<(), InvalidWindowId>
[src]Clear the overlays of the window.
pub fn add_event_handler<F>(
&mut self,
handler: F
) -> Result<(), InvalidWindowId> where
F: 'static + FnMut(&mut WindowHandle<'_>, &mut WindowEvent, &mut EventHandlerControlFlow),
[src]
pub fn add_event_handler<F>(
&mut self,
handler: F
) -> Result<(), InvalidWindowId> where
F: 'static + FnMut(&mut WindowHandle<'_>, &mut WindowEvent, &mut EventHandlerControlFlow),
[src]Add an event handler to the window.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for WindowHandle<'a>
impl<'a> !Send for WindowHandle<'a>
impl<'a> !Sync for WindowHandle<'a>
impl<'a> Unpin for WindowHandle<'a>
impl<'a> !UnwindSafe for WindowHandle<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,