[][src]Trait unsegen::widget::widget::Widget

pub trait Widget {
    fn space_demand(&self) -> Demand2D;
fn draw(&self, window: Window<'_>, hints: RenderingHints); }

A widget is something that can be drawn to a window.

Required methods

fn space_demand(&self) -> Demand2D

Return the current demand for (rectangular) screen estate.

The callee may report different demands on subsequent calls.

fn draw(&self, window: Window<'_>, hints: RenderingHints)

Draw the widget to the given window.

There is no guarantee that the window is of the size requested in space_demand, it can be smaller than the minimum or larger than the maximum (if specified). However, in general, the layouting algorithm tries to honor the demand of the widget.

The hints give the widget some useful information on how to render.

Loading content...

Implementors

impl Widget for LineEdit[src]

impl Widget for LineLabel[src]

impl Widget for LogViewer[src]

impl Widget for PromptLine[src]

impl<R: TableRow + 'static> Widget for Table<R>[src]

Loading content...