pub struct Window<WST = ()> { /* private fields */ }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>
impl<WST: WindowSubtype> Window<WST>
pub fn as_handle(&self) -> WindowHandle
Sourcepub fn set_listener<WML>(&mut self, listener: WML) -> Result<()>
pub fn set_listener<WML>(&mut self, listener: WML) -> Result<()>
Changes the user window message listener.
Sets or removes the top menu bar.
Sourcepub fn add_notification_icon(
&mut self,
options: NotificationIconOptions,
) -> Result<&mut NotificationIcon>
pub fn add_notification_icon( &mut self, options: NotificationIconOptions, ) -> Result<&mut NotificationIcon>
Sourcepub fn get_notification_icon(&self, id: NotificationIconId) -> &NotificationIcon
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.
Sourcepub fn get_notification_icon_mut(
&mut self,
id: NotificationIconId,
) -> &mut NotificationIcon
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.
Sourcepub fn remove_notification_icon(&mut self, id: NotificationIconId)
pub fn remove_notification_icon(&mut self, id: NotificationIconId)
Source§impl Window<()>
impl Window<()>
Sourcepub fn new<WML, PST>(
class: Rc<WindowClass>,
listener: Option<WML>,
caption_text: &str,
appearance: WindowAppearance,
parent: Option<Rc<RefCell<Window<PST>>>>,
) -> Result<Self>
pub fn new<WML, PST>( class: Rc<WindowClass>, listener: Option<WML>, caption_text: &str, appearance: WindowAppearance, parent: Option<Rc<RefCell<Window<PST>>>>, ) -> Result<Self>
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>
impl Window<Layered>
Sourcepub fn new_layered<WML, PST>(
class: Rc<WindowClass>,
listener: Option<WML>,
caption_text: &str,
appearance: WindowAppearance,
parent: Option<Rc<RefCell<Window<PST>>>>,
) -> Result<Self>
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>
Creates a new layered window.
This is analogous to Window::new.
Sourcepub fn set_layered_opacity_alpha(&self, alpha: u8) -> Result<()>
pub fn set_layered_opacity_alpha(&self, alpha: u8) -> Result<()>
Sets the opacity value for a layered window.