@@ -227,6 +227,9 @@ def update(self):
227227 display ._template_origin = new_template .name
228228
229229 def detach (self ):
230+ if self .animation_timer is not None :
231+ self .stop_animating ()
232+
230233 if self .toolbar is not None :
231234 self .toolbar .detach ()
232235 self .toolbar = None
@@ -247,14 +250,12 @@ def detach(self):
247250 self .target .detach ()
248251 self .target = None
249252
250- if self .animation_timer is not None :
251- self .stop_animating ()
252-
253253 for listener in self .listeners :
254254 self .interactor .RemoveObserver (listener )
255255
256256 # if all of the widgets have been cleaned up correctly, this will delete the manager
257257 vtk_ui .manager .delete_manager (self .interactor )
258+ self .interactor .GetRenderWindow ().Render ()
258259
259260 def release (self , object , event ):
260261 if self .clicking is None :
@@ -594,7 +595,7 @@ def set_animation_speed(self, value):
594595 return v
595596
596597 def animate (self , obj , event ):
597- if self .animation_timer is not None and datetime .datetime .now () - self .animation_last_frame_time > datetime .timedelta (0 , 0 , 0 , int ( .9 * 1000. / self .animation_speed ) ):
598+ if self .animation_timer is not None and datetime .datetime .now () - self .animation_last_frame_time > datetime .timedelta (0 , 0 , 0 , self .animation_speed ):
598599 self .animation_last_frame_time = datetime .datetime .now ()
599600 self .canvas .animate .draw_frame ((self .canvas .animate .frame_num + 1 ) % self .canvas .animate .number_of_frames (), render_offscreen = False , allow_static = False )
600601
0 commit comments