@@ -914,7 +914,7 @@ def __init__(self, num, fig):
914914 pos = wx .DefaultPosition
915915 else :
916916 pos = wx .Point (20 , 20 )
917- super ().__init__ (parent = None , id = - 1 , pos = pos , title = "Figure %d" % num )
917+ super ().__init__ (parent = None , id = - 1 , pos = pos )
918918 # Frame will be sized later by the Fit method
919919 _log .debug ("%s - __init__()" , type (self ))
920920 self .num = num
@@ -1022,9 +1022,10 @@ class FigureManagerWx(FigureManagerBase):
10221022
10231023 def __init__ (self , canvas , num , frame ):
10241024 _log .debug ("%s - __init__()" , type (self ))
1025+ self .frame = self .window = frame
1026+ self ._initializing = True
10251027 super ().__init__ (canvas , num )
1026- self .frame = frame
1027- self .window = frame
1028+ self ._initializing = False
10281029
10291030 @property
10301031 def toolbar (self ):
@@ -1034,7 +1035,7 @@ def toolbar(self):
10341035 def toolbar (self , value ):
10351036 # Never allow this, except that base class inits this to None before
10361037 # the frame is set up.
1037- if value is not None or hasattr ( self , "frame" ) :
1038+ if not self . _initializing :
10381039 raise AttributeError ("can't set attribute" )
10391040
10401041 def show (self ):
0 commit comments