[−][src]Trait iced::widget::canvas::Program
This is supported on
feature="canvas"
or feature="glow_canvas"
only.The state and logic of a Canvas
.
A Program
can mutate internal state and produce messages for an
application.
Required methods
fn draw(&self, bounds: Rectangle<f32>, cursor: Cursor) -> Vec<Geometry>
This is supported on
feature="canvas"
or feature="glow_canvas"
only.Provided methods
fn update(
&mut self,
_event: Event,
_bounds: Rectangle<f32>,
_cursor: Cursor
) -> Option<Message>
&mut self,
_event: Event,
_bounds: Rectangle<f32>,
_cursor: Cursor
) -> Option<Message>
This is supported on
feature="canvas"
or feature="glow_canvas"
only.Updates the state of the Program
.
When a Program
is used in a Canvas
, the runtime will call this
method for each Event
.
This method can optionally return a Message
to notify an application
of any meaningful interactions.
By default, this method does and returns nothing.
fn mouse_interaction(
&self,
_bounds: Rectangle<f32>,
_cursor: Cursor
) -> Interaction
&self,
_bounds: Rectangle<f32>,
_cursor: Cursor
) -> Interaction
This is supported on
feature="canvas"
or feature="glow_canvas"
only.Implementations on Foreign Types
impl<'_, T, Message> Program<Message> for &'_ mut T where
T: Program<Message>,
[src]
T: Program<Message>,
fn update(
&mut self,
event: Event,
bounds: Rectangle<f32>,
cursor: Cursor
) -> Option<Message>
[src]
&mut self,
event: Event,
bounds: Rectangle<f32>,
cursor: Cursor
) -> Option<Message>
fn draw(&self, bounds: Rectangle<f32>, cursor: Cursor) -> Vec<Geometry>
[src]
fn mouse_interaction(
&self,
bounds: Rectangle<f32>,
cursor: Cursor
) -> Interaction
[src]
&self,
bounds: Rectangle<f32>,
cursor: Cursor
) -> Interaction