Adding growable rows that don't exist throws error

Hi everyone,

I’m unsure what version this ‘bug’(sort of a bug, not really) was introduced. In anycase, if you make a FlexGridSizer, and setup the growable rows before populating it, it will throw an error in 2.9.4.1.

I attached a sample script showing the problem. Using 2.6 works fine, the latest crashes with:

Traceback (most recent call last):

File “flexgridsample.py”, line 11, in

frame = MainFrame(None)

File “flexgridsample.py”, line 8, in init

self.vbox.AddGrowableRow(2)

File “/usr/local/lib/python2.7/dist-packages/wx/_core.py”, line 15355, in AddGrowableRow

return core.FlexGridSizer_AddGrowableRow(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “!m_rows || idx < (size_t)m_rows” failed at …/src/common/sizer.cpp(1943) in AddGrowableRow(): invalid row index

It may be an issue for older scripts where this behavior didn’t cause an error.

Chris

flexgridsample.py (365 Bytes)

Hi,

This is a good thing since it is now showing you an error in your code
instead of silently doing nothing.

···

On Thu, Aug 2, 2012 at 4:02 PM, Chris Mitchell <chris.mit7@gmail.com> wrote:

Hi everyone,

I'm unsure what version this 'bug'(sort of a bug, not really) was
introduced. In anycase, if you make a FlexGridSizer, and setup the growable
rows before populating it, it will throw an error in 2.9.4.1.

I attached a sample script showing the problem. Using 2.6 works fine, the
latest crashes with:
Traceback (most recent call last):
  File "flexgridsample.py", line 11, in <module>
    frame = MainFrame(None)
  File "flexgridsample.py", line 8, in __init__
    self.vbox.AddGrowableRow(2)
  File "/usr/local/lib/python2.7/dist-packages/wx/_core.py", line 15355, in
AddGrowableRow
    return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "!m_rows || idx < (size_t)m_rows"
failed at ../src/common/sizer.cpp(1943) in AddGrowableRow(): invalid row
index

It may be an issue for older scripts where this behavior didn't cause an
error.

Chris

--
To unsubscribe, send email to wxPython-dev+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-dev?hl=en