Struct iui::controls::Button
[−]
[src]
pub struct Button { /* fields omitted */ }A textual button which users can click on, causing a callback to run.
Methods
impl Button[src]
pub fn show(&mut self, _ctx: &UI)[src]
pub fn hide(&mut self, _ctx: &UI)[src]
pub unsafe fn from_raw(uiButton: *mut uiButton) -> Button[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 uiButton[src]
Return the underlying pointer for this control.
impl Button[src]
pub fn new(_ctx: &UI, text: &str) -> Button[src]
Create a new button with the given text as its label.
pub fn text(&self, _ctx: &UI) -> String[src]
Get a copy of the existing text on the button.
pub fn text_ref(&self, _ctx: &UI) -> &CStr[src]
Get a reference to the existing text on the button.
pub fn set_text(&mut self, _ctx: &UI, text: &str)[src]
Set the text on the button.
pub fn on_clicked<F: FnMut(&mut Button)>(&mut self, _ctx: &UI, callback: F)[src]
Run the given callback when the button is clicked.
Trait Implementations
impl Drop for Button[src]
impl Clone for Button[src]
fn clone(&self) -> Button[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