[][src]Trait kas::Toolkit

pub trait Toolkit {
    fn add_rc(&self, window: Rc<RefCell<dyn Window>>);
fn main(&mut self); fn add<W: Window + 'static>(&self, window: W)
    where
        Self: Sized
, { ... } }

The primary trait to be implemented by KAS toolkits.

A toolkit handles window management and rendering for a GUI.

Any initialisation should be taken care of in the constructor, and de-initialisation in a Drop implementation.

Required methods

fn add_rc(&self, window: Rc<RefCell<dyn Window>>)

Specialised version of add; typically toolkits only need to implement this.

fn main(&mut self)

Run the main loop.

Loading content...

Provided methods

fn add<W: Window + 'static>(&self, window: W) where
    Self: Sized

Assume ownership of and display a window.

Note: typically, one should have W: Clone, enabling multiple usage.

Loading content...

Implementors

Loading content...