@@ -550,7 +550,9 @@ def setup_animation(self):
550550 self .anim_button = anim_toolbar .add_toggle_button ("Animation" , on = self .start_animating , off = self .stop_animating , on_prefix = "Run" , off_prefix = "Stop" )
551551 anim_toolbar .add_button (["Step Forward" ], action = self .step_forward )
552552 anim_toolbar .add_button (["Step Backward" ], action = self .step_back )
553- anim_toolbar .add_slider_button (0 , 0 , self .canvas .animate .number_of_frames (), "Time Slider" , update = self .set_animation_frame , end = self .final_animation_frame )
553+ def get_frame ():
554+ return self .canvas .animate .frame_num
555+ anim_toolbar .add_slider_button (get_frame , 0 , self .canvas .animate .number_of_frames (), "Time Slider" , update = self .set_animation_frame )
554556 anim_toolbar .add_slider_button (self .animation_speed , 1 , 30 , "Frames Per Second" , update = self .set_animation_speed )
555557 self .save_anim_button = anim_toolbar .add_button (["Save Animation" , "Cancel Save" ], action = self .save_animation_press )
556558 self .initialized = True
@@ -645,11 +647,8 @@ def stop_animating(self):
645647
646648 def set_animation_frame (self , value ):
647649 value = int (value )
648- self .canvas .animate .draw_frame (value )
650+ self .canvas .animate .draw_frame (value , allow_static = False , render_offscreen = False )
649651 return value
650- def final_animation_frame (self , value ):
651- value = int (value )
652- self .canvas .animate .draw_frame (value , allow_static = False , render_offscreen = False )
653652
654653 def set_background_red (self , value ):
655654 _ , g , b = self .canvas .backgroundcolor
0 commit comments