Struct iui::prelude::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]
impl Window
pub fn show(&mut self, _ctx: &UI)
[src]
pub fn show(&mut self, _ctx: &UI)
pub fn hide(&mut self, _ctx: &UI)
[src]
pub fn hide(&mut self, _ctx: &UI)
pub unsafe fn from_raw(uiWindow: *mut uiWindow) -> Window
[src]
pub unsafe fn from_raw(uiWindow: *mut uiWindow) -> Window
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]
pub fn ptr(&self) -> *mut uiWindow
Return the underlying pointer for this control.
impl Window
[src]
impl Window
pub fn new(
_ctx: &UI,
title: &str,
width: c_int,
height: c_int,
t: WindowType
) -> Window
[src]
pub fn new(
_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]
pub fn title(&self, _ctx: &UI) -> String
Get the current title of the window.
pub fn title_ref(&self, _ctx: &UI) -> &CStr
[src]
pub fn title_ref(&self, _ctx: &UI) -> &CStr
Get a reference to the current title of the window.
pub fn set_title(&mut self, _ctx: &UI, title: &str)
[src]
pub fn set_title(&mut self, _ctx: &UI, title: &str)
Set the window's title to the given string.
pub fn on_closing<F: FnMut(&mut Window)>(&mut self, _ctx: &UI, callback: F)
[src]
pub fn on_closing<F: FnMut(&mut Window)>(&mut self, _ctx: &UI, callback: F)
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]
pub fn margined(&self, _ctx: &UI) -> bool
Check whether or not this window has margins around the edges.
pub fn set_margined(&mut self, _ctx: &UI, margined: bool)
[src]
pub fn set_margined(&mut self, _ctx: &UI, margined: bool)
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]
pub fn set_child<T: Into<Control>>(&mut self, _ctx: &UI, child: T)
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]
pub fn open_file(&self, _ctx: &UI) -> Option<PathBuf>
Allow the user to select an existing file.
pub fn save_file(&self, _ctx: &UI) -> Option<PathBuf>
[src]
pub fn save_file(&self, _ctx: &UI) -> Option<PathBuf>
Allow the user to select a new or existing file.
pub fn modal_msg(&self, _ctx: &UI, title: &str, description: &str)
[src]
pub fn modal_msg(&self, _ctx: &UI, title: &str, description: &str)
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]
pub fn modal_err(&self, _ctx: &UI, title: &str, description: &str)
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_all_windows()
pub unsafe fn destroy(&self)
[src]
pub unsafe fn destroy(&self)
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 Drop for Window
impl Clone for Window
[src]
impl Clone for Window
fn clone(&self) -> Window
[src]
fn clone(&self) -> Window
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Into<Control> for Window
[src]
impl Into<Control> for Window