pub struct Window { /* private fields */ }Available on crate feature
winio only.Expand description
A simple window.
§Platform specific
- Qt: The desctruct order of Qt requires the window to be dropped last, and you should better put it at the end of the struct.
Implementations§
Source§impl Window
impl Window
Sourcepub fn client_size(&self) -> Result<Size2D<f64, LogicalSpace>, Error>
pub fn client_size(&self) -> Result<Size2D<f64, LogicalSpace>, Error>
The inner client size.
Sourcepub fn set_icon_by_id(&mut self, id: u16) -> Result<(), Error>
Available on Windows only.
pub fn set_icon_by_id(&mut self, id: u16) -> Result<(), Error>
Set window icon by resource ID.
Sourcepub fn set_style(&mut self, s: u32) -> Result<(), Error>
Available on win32 only.
pub fn set_style(&mut self, s: u32) -> Result<(), Error>
win32 only.Set window style.
Sourcepub fn ex_style(&self) -> Result<u32, Error>
Available on win32 only.
pub fn ex_style(&self) -> Result<u32, Error>
win32 only.Get window extended style.
Sourcepub fn set_ex_style(&mut self, s: u32) -> Result<(), Error>
Available on win32 only.
pub fn set_ex_style(&mut self, s: u32) -> Result<(), Error>
win32 only.Set window extended style.
Sourcepub fn backdrop(&self) -> Result<Backdrop, Error>
Available on Windows only.
pub fn backdrop(&self) -> Result<Backdrop, Error>
Get the backdrop effect of the window.
Returns an error if the platform does not support it.
§Platform specific
- Win32: Supported on Windows 11 22H2 and later; some controls might look weird.
- WinUI: Supported on 1.3 and later; the color of the title bar might be different from the client area.
Trait Implementations§
Source§impl AsContainer for Window
impl AsContainer for Window
Source§fn as_container(&self) -> BorrowedContainer<'_>
fn as_container(&self) -> BorrowedContainer<'_>
Get the container handle.
Source§impl AsWindow for Window
impl AsWindow for Window
Source§fn as_window(&self) -> BorrowedWindow<'_>
fn as_window(&self) -> BorrowedWindow<'_>
Get the window handle.
Source§impl Component for Window
impl Component for Window
Source§type Event = WindowEvent
type Event = WindowEvent
The output event type to the parent.
Source§type Message = WindowMessage
type Message = WindowMessage
The input message type to update.
Source§async fn init(
_init: <Window as Component>::Init<'_>,
_sender: &ComponentSender<Window>,
) -> Result<Window, Error>
async fn init( _init: <Window as Component>::Init<'_>, _sender: &ComponentSender<Window>, ) -> Result<Window, Error>
Create the initial component.
Source§async fn update(
&mut self,
message: Self::Message,
sender: &ComponentSender<Self>,
) -> Result<bool, Self::Error>
async fn update( &mut self, message: Self::Message, sender: &ComponentSender<Self>, ) -> Result<bool, Self::Error>
Respond to the message. Return true if need render.
Source§fn render(&mut self, sender: &ComponentSender<Self>) -> Result<(), Self::Error>
fn render(&mut self, sender: &ComponentSender<Self>) -> Result<(), Self::Error>
Render the widgets.
Source§impl Layoutable for Window
impl Layoutable for Window
Source§impl TextWidget for Window
impl TextWidget for Window
Auto Trait Implementations§
impl Freeze for Window
impl RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl UnsafeUnpin for Window
impl UnwindSafe for Window
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more