Skip to main content

Dialog

Trait Dialog 

Source
pub trait Dialog {
    // Required methods
    fn key(&mut self, key: KeyEvent, tx: &AppTx) -> EventState;
    fn mouse(&mut self, m: &MouseEvent, tx: &AppTx) -> EventState;
    fn draw(&mut self, f: &mut Frame<'_>, rect: Rect, theme: &Theme);

    // Provided method
    fn set_error(&mut self, _msg: String) { ... }
}
Expand description

What ActiveDialog needs from each dialog, so its dispatch is one inner() match instead of one match per method. A modal consumes every mouse event (a click must never reach the panels behind it); the impls live next to each dialog.

Required Methods§

Source

fn key(&mut self, key: KeyEvent, tx: &AppTx) -> EventState

Source

fn mouse(&mut self, m: &MouseEvent, tx: &AppTx) -> EventState

Source

fn draw(&mut self, f: &mut Frame<'_>, rect: Rect, theme: &Theme)

Provided Methods§

Source

fn set_error(&mut self, _msg: String)

Show a failure inside the dialog; most have no error row.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§