Trait rustty_oxide::core::widget::Widget
[−]
[src]
pub trait Widget { fn draw(&mut self, parent: &mut CellAccessor); fn pack(
&mut self,
parent: &HasSize,
halign: HorizontalAlign,
valign: VerticalAlign,
margin: (usize, usize)
); fn draw_box(&mut self); fn resize(&mut self, new_size: Size); fn frame(&self) -> &Frame; fn frame_mut(&mut self) -> &mut Frame; }
Widgets are the foundation of UI, all frontend objects inherit the widget type and are generalized through either the widget itself or a specialized widget (e.g. Button, Layout).
Required Methods
fn draw(&mut self, parent: &mut CellAccessor)
Draws the widget to the valid CellAccessor
passed
fn pack(
&mut self,
parent: &HasSize,
halign: HorizontalAlign,
valign: VerticalAlign,
margin: (usize, usize)
)
&mut self,
parent: &HasSize,
halign: HorizontalAlign,
valign: VerticalAlign,
margin: (usize, usize)
)
Aligns the widget with the parent
as reference
fn draw_box(&mut self)
Expose the painter trait draw_box
for all widgets, which outlines
the space enclosed within the widget
fn resize(&mut self, new_size: Size)
Resize the given widget to new dimensions given by Size
fn frame(&self) -> &Frame
Return a reference the renderer, Base
in general cases
fn frame_mut(&mut self) -> &mut Frame
Return a mutable reference to the renderer, Base
in general cases
Implementors
impl Widget for Label
impl Widget for Dialog
impl Widget for StdButton
impl Widget for CheckButton
impl Widget for HorizontalLayout
impl Widget for VerticalLayout
impl Widget for Canvas