Struct winsafe::gui::WindowModeless
source · pub struct WindowModeless(/* private fields */);
Available on crate feature
gui
only.Expand description
An user modeless window, which can handle events. Can be programmatically
created or load a dialog resource from a .res
file.
Implementations§
source§impl WindowModeless
impl WindowModeless
sourcepub fn new(parent: &impl GuiParent, opts: WindowModelessOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: WindowModelessOpts) -> Self
Instantiates a new WindowModeless
object, to be created internally
with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a WindowModeless
in an event closure.
sourcepub fn new_dlg(parent: &impl GuiParent, dialog_id: u16, position: POINT) -> Self
pub fn new_dlg(parent: &impl GuiParent, dialog_id: u16, position: POINT) -> Self
Instantiates a new WindowModeless
object, to be loaded from a dialog
resource with
HINSTANCE::CreateDialogParam
.
If the parent window is a dialog, position is in Dialog Template Units; otherwise in pixels, which will be multiplied to match current system DPI.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a WindowModeless
in an event closure.
Trait Implementations§
source§impl Clone for WindowModeless
impl Clone for WindowModeless
source§fn clone(&self) -> WindowModeless
fn clone(&self) -> WindowModeless
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl GuiParent for WindowModeless
impl GuiParent for WindowModeless
source§fn on(&self) -> &WindowEvents
fn on(&self) -> &WindowEvents
Exposes methods to handle the basic window messages, plus timer and
native control notifications. Read more
source§fn spawn_new_thread<F>(&self, func: F)
fn spawn_new_thread<F>(&self, func: F)
This method calls
std::thread::spawn
, but it allows the returning of
an error value. This error value will be forwarded to the original UI
thread, allowing it to be caught at
WindowMain::run_main
. Read moresource§impl GuiParentPopup for WindowModeless
impl GuiParentPopup for WindowModeless
source§impl GuiWindow for WindowModeless
impl GuiWindow for WindowModeless
source§impl GuiWindowText for WindowModeless
impl GuiWindowText for WindowModeless
source§fn set_text(&self, text: &str)
fn set_text(&self, text: &str)
Sets the text by calling
HWND::SetWindowText
.source§fn text(&self) -> String
fn text(&self) -> String
Retrieves the text by calling
HWND::GetWindowText
.impl Send for WindowModeless
Auto Trait Implementations§
impl Freeze for WindowModeless
impl !RefUnwindSafe for WindowModeless
impl !Sync for WindowModeless
impl Unpin for WindowModeless
impl !UnwindSafe for WindowModeless
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