pub struct Window<'class, 'listener, WML> { /* private fields */ }
Available on crate feature
ui
only.Expand description
A window based on a WindowClass
.
Implementations§
Source§impl<'class, 'listener, WML: WindowMessageListener> Window<'class, 'listener, WML>
impl<'class, 'listener, WML: WindowMessageListener> Window<'class, 'listener, WML>
Sourcepub fn create_new(
class: &'class WindowClass<'_, WML>,
listener: &'listener WML,
window_name: &str,
) -> Result<Self>
pub fn create_new( class: &'class WindowClass<'_, WML>, listener: &'listener WML, window_name: &str, ) -> Result<Self>
Creates a new window.
User interaction with the window will result in messages sent to the WindowMessageListener
provided here.
Sourcepub fn set_listener(&self, listener: &'listener WML) -> Result<()>
pub fn set_listener(&self, listener: &'listener WML) -> Result<()>
Changes the WindowMessageListener
.
Doing this is likely only possible using a WindowMessageListener
that doesn’t contain any closures
since Window
requires the listener to be of a specific type and closures in Rust each have
their own (new) type.
Sourcepub fn add_notification_icon<'a, NI: Icon + 'a>(
&'a self,
options: NotificationIconOptions<NI, &'a str>,
) -> Result<NotificationIcon<'a, WML>>
pub fn add_notification_icon<'a, NI: Icon + 'a>( &'a self, options: NotificationIconOptions<NI, &'a str>, ) -> Result<NotificationIcon<'a, WML>>
Adds a notification icon.
The window’s WindowMessageListener
will receive messages when user interactions with the icon occur.
Trait Implementations§
Source§impl<WML> AsMut<WindowHandle> for Window<'_, '_, WML>
impl<WML> AsMut<WindowHandle> for Window<'_, '_, WML>
Source§fn as_mut(&mut self) -> &mut WindowHandle
fn as_mut(&mut self) -> &mut WindowHandle
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl<WML> AsRef<WindowHandle> for Window<'_, '_, WML>
impl<WML> AsRef<WindowHandle> for Window<'_, '_, WML>
Source§fn as_ref(&self) -> &WindowHandle
fn as_ref(&self) -> &WindowHandle
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl<'class, 'listener, WML> Freeze for Window<'class, 'listener, WML>
impl<'class, 'listener, WML> RefUnwindSafe for Window<'class, 'listener, WML>where
WML: RefUnwindSafe,
impl<'class, 'listener, WML> !Send for Window<'class, 'listener, WML>
impl<'class, 'listener, WML> !Sync for Window<'class, 'listener, WML>
impl<'class, 'listener, WML> Unpin for Window<'class, 'listener, WML>
impl<'class, 'listener, WML> !UnwindSafe for Window<'class, 'listener, WML>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more