[][src]Struct furnace_iui::UiContext

pub struct UiContext { /* fields omitted */ }

Methods

impl UiContext[src]

pub fn init() -> Result<Self, UIError>[src]

Methods from Deref<Target = UI>

pub fn parent_of<T>(&self, control: T) -> Option<Control> where
    T: Into<Control>, 
[src]

pub fn is_toplevel<T>(&self, control: T) -> bool where
    T: Into<Control>, 
[src]

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

pub fn is_shown<T>(&self, control: T) -> bool where
    T: Into<Control>, 
[src]

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

pub fn is_enabled<T>(&self, control: T) -> bool where
    T: Into<Control>, 
[src]

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

pub fn main(&self)[src]

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.

pub fn event_loop(&self) -> EventLoop[src]

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

pub fn quit(&self)[src]

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.

pub fn queue_main<F>(&self, callback: F) where
    F: FnMut(), 
[src]

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();

pub fn on_should_quit<F>(&self, callback: F) where
    F: FnMut(), 
[src]

Set a callback to be run when the application quits.

Trait Implementations

impl Clone for UiContext[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Deref for UiContext[src]

type Target = UI

The resulting type after dereferencing.

impl RenderContext for UiContext[src]

type Widget = Control

type Queue = UiQueue

Auto Trait Implementations

impl !Send for UiContext

impl !Sync for UiContext

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]