Window

Struct Window 

Source
pub struct Window { /* private fields */ }
Expand description

窗口实例

Implementations§

Source§

impl Window

Source

pub fn handle(&self) -> WindowHandle

Source§

impl Window

Source

pub const USER_DEF_BASE: u32 = 1_024u32

用户自定义消息的起始值

Source

pub const APP_DEF_BASE: u32 = 32_768u32

Source

pub unsafe fn send( window: WindowId, msg: u32, wparam: usize, lparam: isize, ) -> isize

向指定窗口回调函数发送自定义消息

§Note

此函数的调用是同步的,它将等待回调函数对消息进行处理,并返回回调函数的返回值

Source

pub unsafe fn post( window: WindowId, msg: u32, wparam: usize, lparam: isize, ) -> Result<i32, SystemError>

向指定窗口回调函数发送自定义消息

§Note

此函数的调用是异步的,它不等待回调函数对消息进行处理,直接返回,此函数不应传递引用

Source§

impl Window

Source

pub fn data<T>(&self) -> The<T>

获取窗口所关联数据的访问器

Trait Implementations§

Source§

impl Clone for Window

Source§

fn clone(&self) -> Window

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Window

Source§

fn eq(&self, other: &Window) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl WindowManager for Window

Source§

fn get_handle(&self) -> usize

Source§

fn id(&self) -> WindowId

Source§

fn show(&self)

显示窗口
Source§

fn hide(&self)

隐藏窗口
Source§

fn set_text(&self, title: &str)

设置窗口文本 Read more
Source§

fn set_title(&self, title: &str)

👎Deprecated since 1.0.0: 此方法已弃用,请使用 WindowManager::set_text() 代替
设置窗口文本 Read more
Source§

fn text(&self) -> String

获取窗口文本 Read more
Source§

fn title(&self) -> String

👎Deprecated since 1.0.0: 此方法已弃用,请使用 WindowManager::text() 代替
获取窗口文本 Read more
Source§

fn set_parent(&self, parent: WindowId)

设置窗口的父窗口
Source§

fn parent(&self) -> Option<WindowHandle>

获取窗口父窗口的句柄
Source§

fn redraw(&self)

指示窗口应该被重新绘制
Source§

fn get_rect(&self) -> Rect<i32>

获取窗口所在的矩形区域坐标
Source§

fn get_client_rect(&self) -> Rect<i32>

获取窗口客户区矩形区域坐标
Source§

impl Eq for Window

Source§

impl StructuralPartialEq 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 UnwindSafe for Window

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.