Struct show_image::WindowHandle[][src]

pub struct WindowHandle<'a> { /* fields omitted */ }

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]

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 id(&self) -> WindowId[src]

Get the window ID.

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]

Get the context handle as mutable reference.

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]

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]

Make the window visible or invisible.

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]

Set the image to display on the window.

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]

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]

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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast<T> for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Upcast<T> for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,