tui_popup

Trait SizedWidgetRef

Source
pub trait SizedWidgetRef: WidgetRef + Debug {
    // Required methods
    fn width(&self) -> usize;
    fn height(&self) -> usize;
}
Expand description

A trait for widgets that have a fixed size.

This trait allows the popup to automatically size itself based on the size of the body widget. Implementing this trait for a widget allows it to be used as the body of a popup. You can also wrap existing widgets in a newtype and implement this trait for the newtype to use them as the body of a popup.

Required Methods§

Source

fn width(&self) -> usize

Source

fn height(&self) -> usize

Implementations on Foreign Types§

Source§

impl SizedWidgetRef for &str

Source§

fn width(&self) -> usize

Source§

fn height(&self) -> usize

Source§

impl SizedWidgetRef for Text<'_>

Source§

fn width(&self) -> usize

Source§

fn height(&self) -> usize

Implementors§