@@ -209,14 +209,13 @@ def filter_destroy(event):
209
209
self .close_event ()
210
210
root .bind ("<Destroy>" , filter_destroy , "+" )
211
211
212
- self ._master = master
213
212
self ._tkcanvas .focus_set ()
214
213
215
214
def _update_device_pixel_ratio (self , event = None ):
216
215
# Tk gives scaling with respect to 72 DPI, but most (all?) screens are
217
216
# scaled vs 96 dpi, and pixel ratio settings are given in whole
218
217
# percentages, so round to 2 digits.
219
- ratio = round (self ._master .call ('tk' , 'scaling' ) / (96 / 72 ), 2 )
218
+ ratio = round (self ._tkcanvas . tk .call ('tk' , 'scaling' ) / (96 / 72 ), 2 )
220
219
if self ._set_device_pixel_ratio (ratio ):
221
220
# The easiest way to resize the canvas is to resize the canvas
222
221
# widget itself, since we implement all the logic for resizing the
@@ -367,7 +366,7 @@ def new_timer(self, *args, **kwargs):
367
366
368
367
def flush_events (self ):
369
368
# docstring inherited
370
- self ._master .update ()
369
+ self ._tkcanvas .update ()
371
370
372
371
def start_event_loop (self , timeout = 0 ):
373
372
# docstring inherited
@@ -379,14 +378,14 @@ def start_event_loop(self, timeout=0):
379
378
else :
380
379
self ._event_loop_id = self ._tkcanvas .after_idle (
381
380
self .stop_event_loop )
382
- self ._master .mainloop ()
381
+ self ._tkcanvas .mainloop ()
383
382
384
383
def stop_event_loop (self ):
385
384
# docstring inherited
386
385
if self ._event_loop_id :
387
- self ._master .after_cancel (self ._event_loop_id )
386
+ self ._tkcanvas .after_cancel (self ._event_loop_id )
388
387
self ._event_loop_id = None
389
- self ._master .quit ()
388
+ self ._tkcanvas .quit ()
390
389
391
390
392
391
class FigureManagerTk (FigureManagerBase ):
0 commit comments