Trait iced_glow::widget::canvas::Program[][src]

pub trait Program<Message> {
    pub fn draw(
        &self,
        bounds: Rectangle<f32>,
        cursor: Cursor
    ) -> Vec<Geometry, Global>; pub fn update(
        &mut self,
        _event: Event,
        _bounds: Rectangle<f32>,
        _cursor: Cursor
    ) -> (Status, Option<Message>) { ... }
pub fn mouse_interaction(
        &self,
        _bounds: Rectangle<f32>,
        _cursor: Cursor
    ) -> Interaction { ... } }
This is supported on crate feature canvas only.

The state and logic of a Canvas.

A Program can mutate internal state and produce messages for an application.

Required methods

pub fn draw(
    &self,
    bounds: Rectangle<f32>,
    cursor: Cursor
) -> Vec<Geometry, Global>
[src]

Draws the state of the Program, producing a bunch of Geometry.

Geometry can be easily generated with a Frame or stored in a Cache.

Loading content...

Provided methods

pub fn update(
    &mut self,
    _event: Event,
    _bounds: Rectangle<f32>,
    _cursor: Cursor
) -> (Status, Option<Message>)
[src]

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.

pub fn mouse_interaction(
    &self,
    _bounds: Rectangle<f32>,
    _cursor: Cursor
) -> Interaction
[src]

Returns the current mouse interaction of the Program.

The interaction returned will be in effect even if the cursor position is out of bounds of the program’s Canvas.

Loading content...

Implementations on Foreign Types

impl<'_, T, Message> Program<Message> for &'_ mut T where
    T: Program<Message>, 
[src]

Loading content...

Implementors

Loading content...