Trait penrose::draw::Widget [−][src]
pub trait Widget {
fn draw(
&mut self,
ctx: &mut dyn DrawContext,
screen: usize,
screen_has_focus: bool,
w: f64,
h: f64
) -> Result<()>;
fn current_extent(
&mut self,
ctx: &mut dyn DrawContext,
h: f64
) -> Result<(f64, f64)>;
fn require_draw(&self) -> bool;
fn is_greedy(&self) -> bool;
}
Expand description
A status bar widget that can be rendered using a DrawContext
Required methods
Render the current state of the widget to the status bar window.
fn current_extent(
&mut self,
ctx: &mut dyn DrawContext,
h: f64
) -> Result<(f64, f64)>
fn current_extent(
&mut self,
ctx: &mut dyn DrawContext,
h: f64
) -> Result<(f64, f64)>
Current required width and height for this widget due to its content
fn require_draw(&self) -> bool
fn require_draw(&self) -> bool
Does this widget currently require re-rendering? (should be updated when ‘draw’ is called)