[−][src]Struct native_windows_gui::Notice
An invisible component that can be triggered by other thread.
A notice object does not send data between threads. Rust has already plenty of way to do this. The notice object only serve to "wake up" the GUI thread.
A notice must have a parent window. If the parent is destroyed before the notice, the notice becomes invalid.
Requires the notice
feature.
Example
use native_windows_gui as nwg; fn build_notice(notice: &mut nwg::Notice, window: &nwg::Window) { nwg::Notice::builder() .parent(window) .build(notice); }
use native_windows_gui as nwg; use std::thread; use std::time; fn notice(noticer: &nwg::Notice) { let sender = noticer.sender(); thread::spawn(move || { thread::sleep(time::Duration::new(5, 0)); sender.notice(); }); }
Fields
handle: ControlHandle
Implementations
impl Notice
[src]
pub fn builder() -> NoticeBuilder
[src]
pub fn create<C: Into<ControlHandle>>(parent: C) -> Result<Notice, NwgError>
[src]
A shortcut over the builder API for the notice object
pub fn valid(&self) -> bool
[src]
Checks if the notice is still usable. A notice becomes unusable when the parent window is destroyed. This will also return false if the notice is not initialized.
pub fn window_handle(&self) -> Option<ControlHandle>
[src]
Return an handle to the notice window or None
if the window was destroyed.
pub fn set_window_handle<C: Into<ControlHandle>>(&mut self, window: C)
[src]
Change the parent window of the notice. This won't update the NoticeSender already created. Panics if the control is not a window-like control or if the notice was not initialized
pub fn sender(&self) -> NoticeSender
[src]
Create a new NoticeSender
bound to this Notice
Trait Implementations
impl Default for Notice
[src]
impl Drop for Notice
[src]
impl Eq for Notice
[src]
impl From<&'_ Notice> for ControlHandle
[src]
impl PartialEq<ControlHandle> for Notice
[src]
pub fn eq(&self, other: &ControlHandle) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Notice> for Notice
[src]
impl PartialEq<Notice> for ControlHandle
[src]
pub fn eq(&self, other: &Notice) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Notice
[src]
impl StructuralPartialEq for Notice
[src]
Auto Trait Implementations
impl RefUnwindSafe for Notice
[src]
impl !Send for Notice
[src]
impl !Sync for Notice
[src]
impl Unpin for Notice
[src]
impl UnwindSafe for Notice
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,