@@ -85,7 +85,7 @@ def new_figure_manager_given_figure(num, figure):
8585 """
8686 _focus = windowing .FocusManager ()
8787 window = Tk .Tk ()
88-
88+
8989 if Tk .TkVersion >= 8.5 :
9090 # put a mpl icon on the window rather than the default tk icon. Tkinter
9191 # doesn't allow colour icons on linux systems, but tk >=8.5 has a iconphoto
@@ -101,7 +101,7 @@ def new_figure_manager_given_figure(num, figure):
101101 except :
102102 # log the failure, but carry on
103103 verbose .report ('Could not load matplotlib icon: %s' % sys .exc_info ()[1 ])
104-
104+
105105 canvas = FigureCanvasTkAgg (figure , master = window )
106106 figManager = FigureManagerTkAgg (canvas , num , window )
107107 if matplotlib .is_interactive ():
@@ -199,7 +199,7 @@ class FigureCanvasTkAgg(FigureCanvasAgg):
199199 65439 : 'dec' ,
200200 65421 : 'enter' ,
201201 }
202-
202+
203203 _keycode_lookup = {
204204 262145 : 'control' ,
205205 524320 : 'alt' ,
@@ -254,7 +254,7 @@ def filter_destroy(evt):
254254
255255 self ._master = master
256256 self ._tkcanvas .focus_set ()
257-
257+
258258 def resize (self , event ):
259259 width , height = event .width , event .height
260260 if self ._resize_callback is not None :
@@ -443,31 +443,31 @@ def _get_key(self, event):
443443 key = chr (val )
444444 else :
445445 key = None
446-
447- # add modifier keys to the key string. Bit details originate from
446+
447+ # add modifier keys to the key string. Bit details originate from
448448 # http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm
449- # BIT_SHIFT = 0x001; BIT_CAPSLOCK = 0x002; BIT_CONTROL = 0x004;
450- # BIT_LEFT_ALT = 0x008; BIT_NUMLOCK = 0x010; BIT_RIGHT_ALT = 0x080;
449+ # BIT_SHIFT = 0x001; BIT_CAPSLOCK = 0x002; BIT_CONTROL = 0x004;
450+ # BIT_LEFT_ALT = 0x008; BIT_NUMLOCK = 0x010; BIT_RIGHT_ALT = 0x080;
451451 # BIT_MB_1 = 0x100; BIT_MB_2 = 0x200; BIT_MB_3 = 0x400;
452- # In general, the modifier key is excluded from the modifier flag,
453- # however this is not the case on "darwin", so double check that
452+ # In general, the modifier key is excluded from the modifier flag,
453+ # however this is not the case on "darwin", so double check that
454454 # we aren't adding repeat modifier flags to a modifier key.
455- modifiers = [(6 , 'super' , 'super' ),
456- (3 , 'alt' , 'alt' ),
455+ modifiers = [(6 , 'super' , 'super' ),
456+ (3 , 'alt' , 'alt' ),
457457 (2 , 'ctrl' , 'control' ),
458458 ]
459459 if sys .platform == 'darwin' :
460- modifiers = [(3 , 'super' , 'super' ),
461- (4 , 'alt' , 'alt' ),
460+ modifiers = [(3 , 'super' , 'super' ),
461+ (4 , 'alt' , 'alt' ),
462462 (2 , 'ctrl' , 'control' ),
463463 ]
464-
464+
465465 if key is not None :
466466 # note, shift is not added to the keys as this is already accounted for
467467 for bitmask , prefix , key_name in modifiers :
468- if event .state & (1 << bitmask ) and key_name not in key :
468+ if event .state & (1 << bitmask ) and key_name not in key :
469469 key = '{}+{}' .format (prefix , key )
470-
470+
471471 return key
472472
473473 def key_press (self , event ):
@@ -542,9 +542,6 @@ def notify_axes_change(fig):
542542 if self .toolbar != None : self .toolbar .update ()
543543 self .canvas .figure .add_axobserver (notify_axes_change )
544544
545- # attach a show method to the figure for pylab ease of use
546- self .canvas .figure .show = lambda * args : self .show ()
547-
548545 def resize (self , width , height = None ):
549546 # before 09-12-22, the resize method takes a single *event*
550547 # parameter. On the other hand, the resize method of other
@@ -852,14 +849,14 @@ def _init_toolbar(self):
852849
853850 for text , tooltip_text , image_file , callback in self .toolitems :
854851 if text is None :
855- # spacer, unhandled in Tk
852+ # spacer, unhandled in Tk
856853 pass
857854 else :
858855 button = self ._Button (text = text , file = image_file ,
859856 command = getattr (self , callback ))
860857 if tooltip_text is not None :
861858 ToolTip .createToolTip (button , tooltip_text )
862-
859+
863860 self .message = Tk .StringVar (master = self )
864861 self ._message_label = Tk .Label (master = self , textvariable = self .message )
865862 self ._message_label .pack (side = Tk .RIGHT )
@@ -954,7 +951,7 @@ def leave(event):
954951 toolTip .hidetip ()
955952 widget .bind ('<Enter>' , enter )
956953 widget .bind ('<Leave>' , leave )
957-
954+
958955 def __init__ (self , widget ):
959956 self .widget = widget
960957 self .tipwindow = None
0 commit comments