Function Window.scheduleAnimation

after drawing, call to schedule redraw if animation is active

void scheduleAnimation();