@@ -902,7 +902,7 @@ def __init__(self, num, fig):
902902 pos = wx .DefaultPosition
903903 else :
904904 pos = wx .Point (20 , 20 )
905- super ().__init__ (parent = None , id = - 1 , pos = pos , title = "Figure %d" % num )
905+ super ().__init__ (parent = None , id = - 1 , pos = pos )
906906 # Frame will be sized later by the Fit method
907907 _log .debug ("%s - __init__()" , type (self ))
908908 self .num = num
@@ -1011,9 +1011,10 @@ class FigureManagerWx(FigureManagerBase):
10111011
10121012 def __init__ (self , canvas , num , frame ):
10131013 _log .debug ("%s - __init__()" , type (self ))
1014+ self .frame = self .window = frame
1015+ self ._initializing = True
10141016 super ().__init__ (canvas , num )
1015- self .frame = frame
1016- self .window = frame
1017+ self ._initializing = False
10171018
10181019 @property
10191020 def toolbar (self ):
@@ -1023,7 +1024,7 @@ def toolbar(self):
10231024 def toolbar (self , value ):
10241025 # Never allow this, except that base class inits this to None before
10251026 # the frame is set up.
1026- if value is not None or hasattr ( self , "frame" ) :
1027+ if not self . _initializing :
10271028 raise AttributeError ("can't set attribute" )
10281029
10291030 def show (self ):
0 commit comments