@@ -1361,6 +1361,8 @@ def _load_bitmap(filename):
1361
1361
1362
1362
1363
1363
_FRAME_ICON = None
1364
+
1365
+
1364
1366
def _set_frame_icon (frame ):
1365
1367
# set frame icon
1366
1368
global _FRAME_ICON
@@ -1369,9 +1371,11 @@ def _set_frame_icon(frame):
1369
1371
for image in ('matplotlib.png' , 'matplotlib_large.png' ):
1370
1372
image = os .path .join (matplotlib .rcParams ['datapath' ], 'images' ,
1371
1373
image )
1372
- if not os .path .exists (image ): continue
1374
+ if not os .path .exists (image ):
1375
+ continue
1373
1376
icon = wx .Icon (_load_bitmap (image ))
1374
- if not icon .IsOk (): return
1377
+ if not icon .IsOk ():
1378
+ return
1375
1379
bundle .AddIcon (icon )
1376
1380
frame .SetIcons (_FRAME_ICON )
1377
1381
@@ -1757,7 +1761,7 @@ def add_toolitem(
1757
1761
tool = self .InsertTool (idx , - 1 , name , bmp , wx .NullBitmap , kind ,
1758
1762
description or "" )
1759
1763
else :
1760
- size = (self .GetTextExtent (name )[0 ]+ 10 ,- 1 )
1764
+ size = (self .GetTextExtent (name )[0 ]+ 10 , - 1 )
1761
1765
if toggle :
1762
1766
control = wx .ToggleButton (self , - 1 , name , size = size )
1763
1767
else :
@@ -1796,6 +1800,7 @@ def toggle_toolitem(self, name, toggled):
1796
1800
else :
1797
1801
tool .GetControl ().SetValue (toggled )
1798
1802
self .Refresh ()
1803
+
1799
1804
def remove_toolitem (self , name ):
1800
1805
for tool , handler in self ._toolitems [name ]:
1801
1806
self .DeleteTool (tool .Id )
0 commit comments