@@ -146,14 +146,17 @@ def OnPageChanged(self, Page=None, trigger=None):
146146 if trigger in ["fit_batch" , "fit_finalize" , "init" ,
147147 "parm_batch" , "parm_finalize" ]:
148148 return
149-
149+
150+ oldpage = self .curpage
151+ self .curpage = self .parent .notebook .GetCurrentPage ()
152+
150153 if Page is not None :
151154 # redraw this tool if necessary
152- if self . curpage is not None :
155+ if oldpage is not None and not isinstance ( oldpage , wx . _core . _wxPyDeadObject ) :
153156 oldmodelid = self .curpage .modelid
154157 else :
155158 oldmodelid = 0
156- newmodelid = Page .modelid
159+ newmodelid = self . curpage .modelid
157160 if oldmodelid != newmodelid :
158161 self .RedrawParameterBox ()
159162
@@ -167,7 +170,7 @@ def OnPageChanged(self, Page=None, trigger=None):
167170 self .dropdown .SetItems (DDlist )
168171 self .dropdown .SetSelection (0 )
169172
170- self . curpage = self . parent . notebook . GetCurrentPage ()
173+
171174
172175
173176 def OnRadioHere (self , event = None ):
@@ -249,7 +252,6 @@ def Redraw(self, e=None):
249252 ## Parameter selection
250253 boxright = wx .StaticBox (panel , label = "Selected parameters" )
251254 rightSizer = wx .StaticBoxSizer (boxright , wx .VERTICAL )
252- boxright .SetSizer (rightSizer )
253255 self .parameter_sizer = rightSizer
254256 self .RedrawParameterBox ()
255257
@@ -310,9 +312,8 @@ def RedrawParameterBox(self, e=None):
310312 box = sizer .GetStaticBox ()
311313 boxs = box .GetBestSize ()
312314 sizs = sizer .GetMinSize ()
313- thesize = (max (boxs [0 ], sizs [0 ]+ 20 ), sizs [1 ])
315+ thesize = (max (boxs [0 ], sizs [0 ]), sizs [1 ])
314316 sizer .SetMinSize (thesize )
315- box .SetMinSize (thesize )
316317 box .SetSize (thesize )
317318
318319 try :
0 commit comments