pub fn draw_loop(&mut self, c: &mut Canvas<Window>) -> bool {
        let mut invalidated = false;
        let cache_size = self.cache.len();

        // Walk the size of the cache and only draw objects that are invalidated.
        for i in 0..cache_size {
            match &self.cache[i] {
                SystemWidget::Base(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }

                SystemWidget::Box(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }

                SystemWidget::Button(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }

                _unused => {
                    // Do nothing
                    eprintln!("[WidgetCache::draw_loop] I'm sent a widget that I can't draw yet!");
                }
            }
        }

        invalidated
    }
/// Draws `Widget`s into the `Canvas`.  Determines whether or not a `Widget` is invalidated,
/// draws it (and its children), and exits after draw completes.  Calls private function
/// `draw`, which is responsible for copying a texture to the main `Canvas`.
///
/// Returns a boolean indicating whether or not the canvas was invalidated and needs to be
/// redrawn.  If not, the event loop will not redraw the canvas.
Draws `Widget`s into the `Canvas`.  Determines whether or not a `Widget` is invalidated,
draws it (and its children), and exits after draw completes.  Calls private function
`draw`, which is responsible for copying a texture to the main `Canvas`.

Returns a boolean indicating whether or not the canvas was invalidated and needs to be
redrawn.  If not, the event loop will not redraw the canvas.
Draws ` Widget ` s into the ` Canvas ` . Determines whether or not a ` Widget ` is invalidated draws it ( and its children ) and exits after draw completes . Calls private function ` draw ` which is responsible for copying a texture to the main ` Canvas ` . Returns a boolean indicating whether or not the canvas was invalidated and needs to be redrawn . If not the event loop will not redraw the canvas .
pub fn draw_loop(&mut self, c: &mut Canvas<Window>) -> bool {
        let mut invalidated = false;
        let cache_size = self.cache.len();
        // Walk the size of the cache and only draw objects that are invalidated.
        for i in 0..cache_size {
            match &self.cache[i] {
                SystemWidget::Base(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }
                SystemWidget::Box(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }
                SystemWidget::Button(x) => {
                    if x.is_invalidated() {
                        invalidated = true;
                        self.draw(i as u32, c);
                    }
                }
                _unused => {
                    // Do nothing
                    eprintln!("[WidgetCache::draw_loop] I'm sent a widget that I can't draw yet!");
                }
            }
        }
        invalidated
    }
pub fn draw_loop ( & mut self , c : & mut Canvas < Window > ) -> bool { let mut invalidated = false ; let cache_size = self . cache . len ( ) ; // Walk the size of the cache and only draw objects that are invalidated. for i in 0 .. cache_size { match & self . cache [ i ] { SystemWidget :: Base ( x ) => { if x . is_invalidated ( ) { invalidated = true ; self . draw ( i as u32 , c ) ; } } SystemWidget :: Box ( x ) => { if x . is_invalidated ( ) { invalidated = true ; self . draw ( i as u32 , c ) ; } } SystemWidget :: Button ( x ) => { if x . is_invalidated ( ) { invalidated = true ; self . draw ( i as u32 , c ) ; } } _unused => { // Do nothing eprintln ! ( " " ) ; } } } invalidated }
Draws `Widget`s into the `Canvas`.
Draws ` Widget ` s into the ` Canvas ` .
&mut self
c
&mut Canvas<Window>
&mut self
c
&mut Canvas<Window>