Struct iui::controls::Window
[−]
[src]
pub struct Window { /* fields omitted */ }
Contains a single child control and displays it and its children in a window on the screen.
Methods
impl Window
[src]
pub fn show(&mut self, _ctx: &UI)
[src]
pub fn hide(&mut self, _ctx: &UI)
[src]
pub unsafe fn from_raw(uiWindow: *mut uiWindow) -> Window
[src]
Create an iui
struct for this control from the raw pointer for it.
Unsafety
The given pointer must point to a valid control or memory unsafety may result.
pub fn ptr(&self) -> *mut uiWindow
[src]
Return the underlying pointer for this control.
impl Window
[src]
pub fn new(
_ctx: &UI,
title: &str,
width: c_int,
height: c_int,
t: WindowType
) -> Window
[src]
_ctx: &UI,
title: &str,
width: c_int,
height: c_int,
t: WindowType
) -> Window
Create a new window with the given title, width, height, and type.
By default, when a new window is created, it will cause the application to quit when closed.
The user can prevent this by adding a custom on_closing
behavior.
pub fn title(&self, _ctx: &UI) -> String
[src]
Get the current title of the window.
pub fn title_ref(&self, _ctx: &UI) -> &CStr
[src]
Get a reference to the current title of the window.
pub fn set_title(&mut self, _ctx: &UI, title: &str)
[src]
Set the window's title to the given string.
pub fn on_closing<F: FnMut(&mut Window)>(&mut self, _ctx: &UI, callback: F)
[src]
Set a callback to be run when the window closes.
This is often used on the main window of an application to quit the application when the window is closed.
pub fn margined(&self, _ctx: &UI) -> bool
[src]
Check whether or not this window has margins around the edges.
pub fn set_margined(&mut self, _ctx: &UI, margined: bool)
[src]
Set whether or not the window has margins around the edges.
pub fn set_child<T: Into<Control>>(&mut self, _ctx: &UI, child: T)
[src]
Sets the window's child widget. The window can only have one child widget at a time.
pub fn open_file(&self, _ctx: &UI) -> Option<PathBuf>
[src]
Allow the user to select an existing file.
pub fn save_file(&self, _ctx: &UI) -> Option<PathBuf>
[src]
Allow the user to select a new or existing file.
pub fn modal_msg(&self, _ctx: &UI, title: &str, description: &str)
[src]
Open a generic message box to show a message to the user. Returns when the user acknowledges the message.
pub fn modal_err(&self, _ctx: &UI, title: &str, description: &str)
[src]
Open an error-themed message box to show a message to the user. Returns when the user acknowledges the message.
pub unsafe fn destroy_all_windows()
[src]
pub unsafe fn destroy(&self)
[src]
Destroys a Window. Any use of the control after this is use-after-free; therefore, this is marked unsafe.
Trait Implementations
impl Drop for Window
[src]
impl Clone for Window
[src]
fn clone(&self) -> Window
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more