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

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

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

Required methods

fn space_demand(&self) -> Demand2D[src]

Return the current demand for (rectangular) screen estate.

The callee may report different demands on subsequent calls.

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

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.

Implementors

impl<'a> Widget for LineEditWidget<'a>[src]

fn space_demand(&self) -> Demand2D[src]

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

impl<'a> Widget for HLayout<'a>[src]

fn space_demand(&self) -> Demand2D[src]

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

impl<'a> Widget for VLayout<'a>[src]

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

Draw the given widgets to the window, from top to bottom.

fn space_demand(&self) -> Demand2D[src]

impl<'a, R: TableRow + 'static> Widget for TableWidget<'a, R>[src]

fn space_demand(&self) -> Demand2D[src]

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

impl<S: AsRef<str>> Widget for S[src]

fn space_demand(&self) -> Demand2D[src]

fn draw(&self, window: Window<'_>, _hints: RenderingHints)[src]

impl<W: Widget> Widget for Centered<W>[src]

fn space_demand(&self) -> Demand2D[src]

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

impl<W: Widget, F: Fn(Window<'_>, RenderingHints) -> Window<'_>> Widget for WithWindow<W, F>[src]

fn space_demand(&self) -> Demand2D[src]

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

impl<W: Widget, F: Fn(Demand2D) -> Demand2D> Widget for WithDemand<W, F>[src]

fn space_demand(&self) -> Demand2D[src]

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