@@ -143,6 +143,7 @@ def run(self):
143143 for motion in self ._motions :
144144 try :
145145 next (motion )()
146+ self .canvas .update ()
146147 except StopIteration :
147148 self ._motions .remove (motion )
148149 break
@@ -241,8 +242,8 @@ def __eq__(self):
241242
242243class Window (widget .PrimaryCanvas ):
243244 animation_speed = 4
244- _current = None
245- _views = {}
245+ current = None
246+ views = {}
246247
247248 def init (self ):
248249 self .animater = Animater (self )
@@ -265,12 +266,12 @@ def __set(self, view, coord, viewtype):
265266 wid = self .__set_image (view , coord )
266267 else :
267268 wid = self .__set_widget (view , coord )
268- self ._views [view ] = wid
269+ self .views [view ] = wid
269270 return wid
270271
271272 def set_view (self , view : tk .Widget , viewtype = 'image' ):
272- self ._current = view
273- self .__set (self ._current , self .origin , viewtype )
273+ self .current = view
274+ self .__set (self .current , self .origin , viewtype )
274275
275276 def move_view (self , wid , end ):
276277 self .animater .add_motion (
@@ -285,22 +286,22 @@ def move_in(self, view, direction: Direction, viewtype='image'):
285286 return wid
286287
287288 def move_out (self , view , direction , viewtype = 'image' ):
288- wid = self ._views [view ]
289+ wid = self .views [view ]
289290 distance = self .get_distance (direction )
290291 end = self .origin + distance
291292 self .move_view (wid , end )
292- del self ._views [view ]
293+ del self .views [view ]
293294
294295 def change_view (self , view : tk .Widget , direction : Direction , viewtype = 'image' ):
295296 if not isinstance (direction , Direction ):
296297 direction = Direction [direction .upper ()] # Cast string for convenience
297298 self .animater .clear ()
298299
299- self .move_out (self ._current , direction , viewtype = viewtype )
300+ self .move_out (self .current , direction , viewtype = viewtype )
300301 self .move_in (view , direction .flip (), viewtype = viewtype )
301302
302303 self .animater .start ()
303- self ._current = view
304+ self .current = view
304305
305306 def get_distance (self , direction : Direction ):
306307 if not isinstance (direction , Direction ):
0 commit comments