Struct flo_ui::BindingCanvas
[−]
[src]
pub struct BindingCanvas { /* fields omitted */ }
The binding canvas is a canvas that can have an attached rendering function. It will invalidate itself if any bindings used in that rendering function are changed.
Methods
impl BindingCanvas
[src]
pub fn new() -> BindingCanvas
[src]
Creates a new BindingCanvas
pub fn from(canvas: Arc<Canvas>) -> BindingCanvas
[src]
Creates a new binding canvas from a canvas
pub fn with_drawing<DrawingFn: 'static + Fn(&mut GraphicsPrimitives) + Send + Sync>(
draw: DrawingFn
) -> BindingCanvas
[src]
draw: DrawingFn
) -> BindingCanvas
Creates a new BindingCanvas with a drawing function
pub fn on_redraw<DrawingFn: 'static + Fn(&mut GraphicsPrimitives) + Send + Sync>(
&self,
draw: DrawingFn
)
[src]
&self,
draw: DrawingFn
)
Sets the drawing function for the canvas
Canvases don't have a drawing function by default, so it's safe to draw directly on them as they'll never become invalidated. Once a drawing function is set, any bindings it may have will cause it to become invalidated if they change. Additionally, setting a drawing function will invalidate the canvas.
pub fn redraw_if_invalid(&self)
[src]
Redraws the canvas if it is marked as invalid
pub fn invalidate(&self)
[src]
Marks this canvas as invalidated (will be redrawn on the next request)
Methods from Deref<Target = Canvas>
pub fn write(&self, to_draw: Vec<Draw>)
[src]
Sends some new drawing commands to this canvas
pub fn draw<FnAction>(&self, action: FnAction) where
FnAction: Send + FnOnce(&mut GraphicsPrimitives),
[src]
FnAction: Send + FnOnce(&mut GraphicsPrimitives),
Provides a way to draw on this canvas via a GC
ⓘImportant traits for Box<W>pub fn stream(&self) -> Box<Stream<Item = Draw, Error = ()> + 'static + Send>
[src]
Creates a stream for reading the instructions from this canvas
pub fn get_drawing(&self) -> Vec<Draw>
[src]
Retrieves the list of drawing actions in this canvas