Trait modalkit_ratatui::Window

source ·
pub trait Window<I: ApplicationInfo>: WindowOps<I> + Sized {
    // Required methods
    fn id(&self) -> I::WindowId;
    fn get_win_title(&self, store: &mut Store<I>) -> Line<'_>;
    fn open(id: I::WindowId, store: &mut Store<I>) -> UIResult<Self, I>;
    fn find(name: String, store: &mut Store<I>) -> UIResult<Self, I>;
    fn posn(index: usize, store: &mut Store<I>) -> UIResult<Self, I>;
    fn unnamed(store: &mut Store<I>) -> UIResult<Self, I>;

    // Provided method
    fn get_tab_title(&self, store: &mut Store<I>) -> Line<'_> { ... }
}
Expand description

A widget that the user can open and close on the screen.

Required Methods§

source

fn id(&self) -> I::WindowId

Get the identifier for this window.

source

fn get_win_title(&self, store: &mut Store<I>) -> Line<'_>

Get the title to show in the window layout.

source

fn open(id: I::WindowId, store: &mut Store<I>) -> UIResult<Self, I>

Open a window that displays the content referenced by id.

source

fn find(name: String, store: &mut Store<I>) -> UIResult<Self, I>

Open a window given a name to lookup.

source

fn posn(index: usize, store: &mut Store<I>) -> UIResult<Self, I>

Open a globally indexed window given a position.

source

fn unnamed(store: &mut Store<I>) -> UIResult<Self, I>

Open a default window when no target has been specified.

Provided Methods§

source

fn get_tab_title(&self, store: &mut Store<I>) -> Line<'_>

Get the title to show in the tab list when this is the currently focused window.

The default implementation will use the same title as shown in the window.

Object Safety§

This trait is not object safe.

Implementors§