pub struct Tui { /* private fields */ }Expand description
There’s two types of lifetimes the TUI code needs to manage:
- Across frames
- Per frame
Tui manages the first one. It’s also the entrypoint for
everything else you may want to do.
Implementations§
Source§impl Tui
impl Tui
Sourcepub fn setup_indexed_colors(&mut self, colors: [u32; 18])
pub fn setup_indexed_colors(&mut self, colors: [u32; 18])
Sets up the framebuffer’s color palette.
Sourcepub fn setup_modifier_translations(
&mut self,
translations: ModifierTranslations,
)
pub fn setup_modifier_translations( &mut self, translations: ModifierTranslations, )
Set up translations for Ctrl/Alt/Shift modifiers.
Sourcepub fn set_floater_default_bg(&mut self, color: u32)
pub fn set_floater_default_bg(&mut self, color: u32)
Set the default background color for floaters (dropdowns, etc.).
Sourcepub fn set_floater_default_fg(&mut self, color: u32)
pub fn set_floater_default_fg(&mut self, color: u32)
Set the default foreground color for floaters (dropdowns, etc.).
Sourcepub fn set_modal_default_bg(&mut self, color: u32)
pub fn set_modal_default_bg(&mut self, color: u32)
Set the default background color for modals.
Sourcepub fn set_modal_default_fg(&mut self, color: u32)
pub fn set_modal_default_fg(&mut self, color: u32)
Set the default foreground color for modals.
Sourcepub fn read_timeout(&mut self) -> Duration
pub fn read_timeout(&mut self) -> Duration
If the TUI is currently running animations, etc.,
this will return a timeout smaller than time::Duration::MAX.
Sourcepub fn indexed(&self, index: IndexedColor) -> u32
pub fn indexed(&self, index: IndexedColor) -> u32
Returns an indexed color from the framebuffer.
Sourcepub fn indexed_alpha(
&self,
index: IndexedColor,
numerator: u32,
denominator: u32,
) -> u32
pub fn indexed_alpha( &self, index: IndexedColor, numerator: u32, denominator: u32, ) -> u32
Returns an indexed color from the framebuffer with the given alpha.
See Framebuffer::indexed_alpha().
Sourcepub fn contrasted(&self, color: u32) -> u32
pub fn contrasted(&self, color: u32) -> u32
Returns a color in contrast with the given color.
See Framebuffer::contrasted().
Sourcepub fn clipboard_ref(&self) -> &Clipboard
pub fn clipboard_ref(&self) -> &Clipboard
Returns the clipboard.
Sourcepub fn clipboard_mut(&mut self) -> &mut Clipboard
pub fn clipboard_mut(&mut self) -> &mut Clipboard
Returns the clipboard (mutable).
Sourcepub fn create_context<'a, 'input>(
&'a mut self,
input: Option<Input<'input>>,
) -> Context<'a, 'input>
pub fn create_context<'a, 'input>( &'a mut self, input: Option<Input<'input>>, ) -> Context<'a, 'input>
Starts a new frame and returns a Context for it.
Sourcepub fn needs_settling(&mut self) -> bool
pub fn needs_settling(&mut self) -> bool
After you finished processing all input, continue redrawing your UI until this returns false.
Sourcepub fn render<'a>(&mut self, arena: &'a Arena) -> ArenaString<'a>
pub fn render<'a>(&mut self, arena: &'a Arena) -> ArenaString<'a>
Renders the last frame into the framebuffer and returns the VT output.
Sourcepub fn debug_layout<'a>(&mut self, arena: &'a Arena) -> ArenaString<'a>
pub fn debug_layout<'a>(&mut self, arena: &'a Arena) -> ArenaString<'a>
Outputs a debug string of the layout and focus tree.