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]

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Downcast<T> for T

pub fn downcast(&self) -> &T

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[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]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<T> Upcast<T> for T

pub fn upcast(&self) -> Option<&T>

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

pub fn vzip(self) -> V