Skip to main content

WidgetDrawFunction

Type Alias WidgetDrawFunction 

Source
pub type WidgetDrawFunction<Window, States> = fn(window: &mut Window, pixels: &mut Vec<Color>, states: &mut States);
Expand description

The widget redraw callback function

This function is called whenever the widget must be redrawn. It’s called with a mutable pointer to the widget pixels which are expected to be updated. The widget pixels is expressed as an array of colors with a length equal to “width x height” of the widget size.

  • pixels - The widget pixels to be updated.

Note that the signature of this function will evolve to be more convenient to work with, and to get rid of dependency on the Color struct (the widget module should not depend on the image module).