[−][src]Struct native_windows_gui::Window
A basic top level window. At least one top level window is required to make a NWG application.
Windows can be heavily customized using the window flags. If your application don't need a visible window
(ex: a system tray app), use MessageWindow instead.
Builder parameters:
flags: The window flags. SeeWindowFlagstitle: The text in the window title barsize: The default size of the windowposition: The default position of the window in the desktopicon: The window iconaccept_file: If the window should accept files by drag & droptopmost: If the window should always be on top of other system windowparent: Logical parent of the window, unlike children controls, this is NOT required.
Control events:
OnInit: The window was createdMousePress(_): Generic mouse press events on the buttonOnMouseMove: Generic mouse mouse eventOnMouseWheel: Generic mouse wheel eventOnPaint: Generic on paint eventOnKeyPress: Generic key pressOnKeyRelease: Generic ket releaseOnResize: When the window is resizedOnResizeBegin: Just before the window begins being resized by the userOnResizeEnd: Just after the user stops resizing the windowOnWindowMaximize: When the window is maximizedOnWindowMinimize: When the window is minimizedOnMove: When the window is moved by the userOnFileDrop: When a file is dropped in the window (only raised if accept_file is set)
Fields
handle: ControlHandleImplementations
impl Window[src]
pub fn builder<'a>() -> WindowBuilder<'a>[src]
pub fn invalidate(&self)[src]
Force the window to refraw iteself and all its children
pub fn close(&self)[src]
Close the window as if the user clicked the X button.
pub fn icon(&self) -> Option<Icon>[src]
Return the icon of the window
pub fn set_icon(&self, icon: Option<&Icon>)[src]
Set the icon in the window
- icon: The new icon. If None, the icon is removed
pub fn focus(&self) -> bool[src]
Return true if the control currently has the keyboard focus
pub fn set_focus(&self)[src]
Set the keyboard focus on the button
pub fn enabled(&self) -> bool[src]
Return true if the control user can interact with the control, return false otherwise
pub fn set_enabled(&self, v: bool)[src]
Enable or disable the control
pub fn visible(&self) -> bool[src]
Return true if the control is visible to the user. Will return true even if the control is outside of the parent client view (ex: at the position (10000, 10000))
pub fn set_visible(&self, v: bool)[src]
Show or hide the control to the user
pub fn size(&self) -> (u32, u32)[src]
Return the size of the button in the parent window
pub fn set_size(&self, x: u32, y: u32)[src]
Set the size of the button in the parent window
pub fn position(&self) -> (i32, i32)[src]
Return the position of the button in the parent window
pub fn set_position(&self, x: i32, y: i32)[src]
Set the position of the button in the parent window
pub fn text(&self) -> String[src]
Return window title
pub fn set_text<'a>(&self, v: &'a str)[src]
Set the window title
pub fn class_name(&self) -> &'static str[src]
Winapi class name used during control creation
pub fn flags(&self) -> u32[src]
pub fn forced_flags(&self) -> u32[src]
Winapi flags required by the control
Trait Implementations
impl Default for Window[src]
impl Drop for Window[src]
impl Eq for Window[src]
impl<'_> From<&'_ Window> for ControlHandle[src]
impl PartialEq<ControlHandle> for Window[src]
fn eq(&self, other: &ControlHandle) -> bool[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool1.0.0[src]
impl PartialEq<Window> for Window[src]
impl PartialEq<Window> for ControlHandle[src]
impl StructuralEq for Window[src]
impl StructuralPartialEq for Window[src]
Auto Trait Implementations
impl RefUnwindSafe for Window
impl !Send for Window
impl !Sync for Window
impl Unpin for Window
impl UnwindSafe for Window
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,
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.
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>,