@@ -575,7 +575,7 @@ def on_notify_filter(*args):
575
575
576
576
def configure_subplots (self , button ):
577
577
toolfig = Figure (figsize = (6 , 3 ))
578
- canvas = self ._get_canvas (toolfig )
578
+ canvas = type ( self .canvas ) (toolfig )
579
579
toolfig .subplots_adjust (top = 0.9 )
580
580
# Need to keep a reference to the tool.
581
581
_tool = SubplotTool (self .canvas .figure , toolfig )
@@ -601,9 +601,6 @@ def configure_subplots(self, button):
601
601
vbox .pack_start (canvas , True , True , 0 )
602
602
window .show ()
603
603
604
- def _get_canvas (self , fig ):
605
- return self .canvas .__class__ (fig )
606
-
607
604
def set_history_buttons (self ):
608
605
can_backward = self ._nav_stack ._pos > 0
609
606
can_forward = self ._nav_stack ._pos < len (self ._nav_stack ._elements ) - 1
@@ -809,10 +806,19 @@ def set_cursor(self, cursor):
809
806
810
807
811
808
class ConfigureSubplotsGTK3 (backend_tools .ConfigureSubplotsBase , Gtk .Window ):
812
- def __init__ (self , * args , ** kwargs ):
813
- backend_tools .ConfigureSubplotsBase .__init__ (self , * args , ** kwargs )
814
- self .window = None
815
-
809
+ @cbook .deprecated ("3.2" )
810
+ @property
811
+ def window (self ):
812
+ if not hasattr (self , "_window" ):
813
+ self ._window = None
814
+ return self ._window
815
+
816
+ @window .setter
817
+ @cbook .deprecated ("3.2" )
818
+ def window (self , window ):
819
+ self ._window = window
820
+
821
+ @cbook .deprecated ("3.2" )
816
822
def init_window (self ):
817
823
if self .window :
818
824
return
@@ -846,16 +852,17 @@ def init_window(self):
846
852
self .vbox .pack_start (canvas , True , True , 0 )
847
853
self .window .show ()
848
854
855
+ @cbook .deprecated ("3.2" )
849
856
def destroy (self , * args ):
850
857
self .window .destroy ()
851
858
self .window = None
852
859
853
860
def _get_canvas (self , fig ):
854
861
return self .canvas .__class__ (fig )
855
862
856
- def trigger (self , sender , event , data = None ):
857
- self . init_window ()
858
- self .window . present ( )
863
+ def trigger (self , * args ):
864
+ NavigationToolbar2GTK3 . configure_subplots (
865
+ self ._make_classic_style_pseudo_toolbar (), None )
859
866
860
867
861
868
class HelpGTK3 (backend_tools .ToolHelpBase ):
0 commit comments