- summary: Designer hangs on wxFlexGridSizer with customized min size --> Designer hangs on sizer with customized min size
Hello.
There is a bug in Boa Constructor, in the way the
minimal size of a wx/Box/Grid/wxFlexGrid/Sizer is handled.
By default, no value is set for this field, and the
Inspector show a min size of (10, 10) when using the
Designer. Customizing this value prevents the Designer
from loading.
It's easy to reproduce: create some frame (any kind),
then create a sizer in it using the designer. In order
to check that all went right, just create frame and
designer, and then post the changes and save the frame
file. Then reopen the sizer and, in the Inspector
window, edit the 'MinSize' field.
Changing this field will generate a call to the
SetMinSize method of the sizer, similar to the
following example:
def _init_sizers(self):
# generated method, don't edit
self.boxSizer1 = wxBoxSizer(orient=wxVERTICAL)
--> self.boxSizer1.SetMinSize(wxSize(10, 13))
<--
This is the only change I can find in the source file.
From now on, it becomes impossible to open the designer
again: it stops on a "key error", probably when parsing
this line. Removing it is enough to fix the problem.
This has been tested and verified with the following
sizers: wxBoxSizer, wxGridSizer, wxFlexGridSizer. I did
not try with the wxStaticBoxSizer and the
wxNotebookSizer because , well, I didn't want to drown
a simple bug report into useless complexity :)
I run Boa Constructor 0.3.0 (python 2.3.5, WXGTK
2.4.2.4) on Debian GNU/Linux "testing" (all is
installed from Debian regular packages).
Here is the trace back for the error reported by the
Designer (regular frame, wxBoxSizer case):
22:34:20: Traceback (most recent call last):
22:34:20: File
"/usr/share/boa-constructor/Models/wxPythonControllers.py",
line 80, in OnDesigner
22:34:20: self.showDesigner()
22:34:20: File
"/usr/share/boa-constructor/Models/wxPythonControllers.py",
line 159,in showDesigner
22:34:20: sizersView.initialize()
22:34:20: File
"/usr/share/boa-constructor/Views/DataView.py", line
71, in initialize
22:34:20:
self.initObjectsAndCompanions(objCol.creators, objCol,
deps, depLinks)
22:34:20: File
"/usr/share/boa-constructor/Views/SizersView.py", line
119, in initObjectsAndCompanions
22:34:20: compn, ctrl =
self.controllerView.objects[ctrlName][:2]
22:34:20: KeyError: 'boxSizer1'
Best regards.