[−][src]Trait unsegen::widget::widget::Widget
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.