[][src]Trait kas::Window

pub trait Window: Widget {
    fn as_widget(&self) -> &dyn Widget;
fn as_widget_mut(&mut self) -> &mut dyn Widget;
fn handle_action(
        &mut self,
        tk: &dyn TkWidget,
        action: Action,
        num: u32
    ) -> GuiResponse;
fn callbacks(&self) -> Vec<(usize, Condition)>;
fn trigger_callback(&mut self, index: usize, tk: &dyn TkWidget);
fn on_start(&mut self, tk: &dyn TkWidget); }

A window is a drawable interactive region provided by windowing system.

Required methods

fn as_widget(&self) -> &dyn Widget

Upcast

Note: needed because Rust does not yet support trait object upcasting

fn as_widget_mut(&mut self) -> &mut dyn Widget

Upcast, mutably

Note: needed because Rust does not yet support trait object upcasting

fn handle_action(
    &mut self,
    tk: &dyn TkWidget,
    action: Action,
    num: u32
) -> GuiResponse

Handle a high-level event directed at the widget identified by num, and return a user-defined message.

fn callbacks(&self) -> Vec<(usize, Condition)>

Get a list of available callbacks.

This returns a sequence of (index, condition) values. The toolkit should call trigger_callback(index, tk) whenever the condition is met.

fn trigger_callback(&mut self, index: usize, tk: &dyn TkWidget)

Trigger a callback (see iter_callbacks).

fn on_start(&mut self, tk: &dyn TkWidget)

Called by the toolkit after the window has been created and before it is drawn. This allows callbacks to be invoked "on start".

Loading content...

Implementors

impl<M: Debug, H> Window for MessageBox<M, H>
[src]

impl<R, W: Widget + Handler<Response = R> + 'static> Window for SimpleWindow<W> where
    GuiResponse: From<R>,
    R: From<NoResponse>, 
[src]

fn trigger_callback(&mut self, index: usize, tk: &dyn TkWidget)
[src]

Trigger a callback (see iter_callbacks).

Loading content...