Struct iui::UI[][src]

pub struct UI { /* fields omitted */ }

A handle to user interface functionality.

Methods

impl UI
[src]

Set the parent control of this control, "moving" it to a new place in the UI tree or, if passed None, removing it from the tree.

Returns true if this control is a top-level control; the root of the UI tree.

Returns true if this control is currently set to be displayed.

Sets whether or not the control should be displayed.

Returns true if the control is enabled (can be interacted with).

Sets the enable/disable state of the control. If disabled, a control cannot be interacted with, and visual cues to that effect are presented to the user.

impl UI
[src]

Initializes the underlying UI bindings, producing a UI struct which can be used to actually build your user interface. This is a reference counted type; clone it to get an additional reference that can be passed to, e.g., callbacks.

Only one libUI binding can be active at once; if multiple instances are detected, this function will return a MultipleInitError. Be aware the Cocoa (GUI toolkit on Mac OS) requires that the first thread spawned controls the UI, so do not spin off your UI interactions into an alternative thread. You're likely to have problems on Mac OS.

{
    let ui1 = UI::init().unwrap();

    // This will fail because there is already an instance of UI.
    let ui2 = UI::init();
    assert!(ui2.is_err());

    // ui1 dropped here.
}
let ui3 = UI::init().unwrap();

If libUI cannot initialize its hooks into the platform bindings, this function will return a FailedInitError with the description of the problem.

Hands control of this thread to the UI toolkit, allowing it to display the UI and respond to events. Does not return until the UI quits.

For more control, use the EventLoop struct.

Returns an EventLoop, a struct that allows you to step over iterations or events in the UI.

Running this function causes the UI to quit, exiting from main and no longer showing any widgets.

Run in every window's default on_closing callback.

Queues a function to be executed on the GUI threa when next possible. Returns immediately, not waiting for the function to be executed.

Example

use iui::prelude::*;

let ui = UI::init().unwrap();

ui.queue_main(|| { println!("Runs first") } );
ui.queue_main(|| { println!("Runs second") } );
ui.quit();

Set a callback to be run when the application quits.

Trait Implementations

impl Clone for UI
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl !Send for UI

impl !Sync for UI