@@ -59,6 +59,13 @@ def cursord(self):
59
59
except TypeError as exc :
60
60
return {}
61
61
62
+ icon_filename = _api .deprecated ("3.6" , obj_type = "" )(property (
63
+ lambda self :
64
+ "matplotlib.png" if sys .platform == "win32" else "matplotlib.svg" ))
65
+ window_icon = _api .deprecated ("3.6" , obj_type = "" )(property (
66
+ lambda self :
67
+ str (cbook ._get_data_path ("images" , __getattr__ ("icon_filename" )))))
68
+
62
69
63
70
@functools .lru_cache ()
64
71
def _mpl_to_gtk_cursor (mpl_cursor ):
@@ -307,7 +314,9 @@ def __init__(self, canvas, num):
307
314
super ().__init__ (canvas , num )
308
315
309
316
self .window .set_wmclass ("matplotlib" , "Matplotlib" )
310
- self .window .set_icon_from_file (window_icon )
317
+ icon_ext = "png" if sys .platform == "win32" else "svg"
318
+ self .window .set_icon_from_file (
319
+ str (cbook ._get_data_path (f"images/matplotlib.{ icon_ext } " )))
311
320
312
321
self .vbox = Gtk .Box ()
313
322
self .vbox .set_property ("orientation" , Gtk .Orientation .VERTICAL )
@@ -698,14 +707,6 @@ def trigger(self, *args, **kwargs):
698
707
clipboard .set_image (pb )
699
708
700
709
701
- # Define the file to use as the GTk icon
702
- if sys .platform == 'win32' :
703
- icon_filename = 'matplotlib.png'
704
- else :
705
- icon_filename = 'matplotlib.svg'
706
- window_icon = str (cbook ._get_data_path ('images' , icon_filename ))
707
-
708
-
709
710
def error_msg_gtk (msg , parent = None ):
710
711
if parent is not None : # find the toplevel Gtk.Window
711
712
parent = parent .get_toplevel ()
0 commit comments