Window

Struct Window 

Source
pub struct Window<WST = ()> { /* private fields */ }
Available on crate feature ui only.
Expand description

A window based on a WindowClass.

§Multithreading

Window is not Send because the window procedure and window destruction calls must only be called from the creating thread.

Implementations§

Source§

impl<WST: WindowSubtype> Window<WST>

Source

pub fn as_handle(&self) -> WindowHandle

Source

pub fn set_listener<WML>(&mut self, listener: WML) -> Result<()>
where WML: FnMut(&ListenerMessage) -> ListenerAnswer + 'static,

Changes the user window message listener.

Source

pub fn set_menu(&mut self, menu: Option<&MenuBar>) -> Result<()>

Sets or removes the top menu bar.

Source

pub fn add_notification_icon( &mut self, options: NotificationIconOptions, ) -> Result<&mut NotificationIcon>

Adds a new notification icon.

§Panics

Will panic if the notification icon ID already exists.

Source

pub fn get_notification_icon(&self, id: NotificationIconId) -> &NotificationIcon

Returns a reference to a previously added notification icon.

§Panics

Will panic if the ID doesn’t exist.

Source

pub fn get_notification_icon_mut( &mut self, id: NotificationIconId, ) -> &mut NotificationIcon

Returns a mutable reference to a previously added notification icon.

§Panics

Will panic if the ID doesn’t exist.

Source

pub fn remove_notification_icon(&mut self, id: NotificationIconId)

Removes a notification icon.

§Panics

Will panic if the ID doesn’t exist.

Source§

impl Window<()>

Source

pub fn new<WML, PST>( class: Rc<WindowClass>, listener: Option<WML>, caption_text: &str, appearance: WindowAppearance, parent: Option<Rc<RefCell<Window<PST>>>>, ) -> Result<Self>
where WML: FnMut(&ListenerMessage) -> ListenerAnswer + 'static, PST: WindowSubtype,

Creates a new window.

User interaction with the window will result in messages sent to the window message listener provided here.

§Generics

Note that you can use DefaultWmlType for the WML type parameter when not providing a listener.

Source§

impl Window<Layered>

Source

pub fn new_layered<WML, PST>( class: Rc<WindowClass>, listener: Option<WML>, caption_text: &str, appearance: WindowAppearance, parent: Option<Rc<RefCell<Window<PST>>>>, ) -> Result<Self>
where WML: FnMut(&ListenerMessage) -> ListenerAnswer + 'static, PST: WindowSubtype,

Creates a new layered window.

This is analogous to Window::new.

Source

pub fn set_layered_opacity_alpha(&self, alpha: u8) -> Result<()>

Sets the opacity value for a layered window.

Source§

impl Window<Magnifier>

Source

pub fn new_magnifier( caption_text: &str, appearance: WindowAppearance, parent: Rc<RefCell<Window<Layered>>>, ) -> Result<Self>

Source

pub fn set_magnification_factor(&self, mag_factor: f32) -> Result<()>

Source

pub fn set_magnification_source(&self, source: Rectangle) -> Result<()>

Source

pub fn set_lens_use_bitmap_smoothing(&self, use_smoothing: bool) -> Result<()>

Trait Implementations§

Source§

impl<WST> Deref for Window<WST>

Source§

type Target = WindowHandle

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<WST> Drop for Window<WST>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<WST> Freeze for Window<WST>

§

impl<WST = ()> !RefUnwindSafe for Window<WST>

§

impl<WST = ()> !Send for Window<WST>

§

impl<WST = ()> !Sync for Window<WST>

§

impl<WST> Unpin for Window<WST>
where WST: Unpin,

§

impl<WST = ()> !UnwindSafe for Window<WST>

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V