[wxPython-users] GridCellNumberEditor crash

Ronald A. Stack rstack at distantfocus.com
Sat Dec 2 10:25:16 PST 2006


Robin Dunn wrote:
> Ronald A. Stack wrote:
> 
>> Here is a small standalone app that reproduces the error. Just to be clear,
>> the crash happens when one changes the cell value from the present setting
>> and instead of pressing enter or using the arrows to move to another cell
>> one clicks the mouse on another cell. Note that I have also just run this
>> on my Mandrake 10.1 install and it segfaults as well. I have provided the
>> backtrace from gdb below.
> 
> As can be seen in the backtrace the problem comes up because there are still
> pending events for the cell editor (it lost focus) but you've already
> destroyed the old cell editor by creating and assigning a new one to the
> cell.  If you change your code so it sets the new editor later via a
> wx.CallAfter then you can avoid the problem.
> 
> 

That makes sense. I've tested the small sample with this implemented and
it works; thank you for your patience and help on this. One more question,
it seems that attaching a new editor just to change the limits is a bit,
well, overkill. It seems that one should be able to get a handle to the
cell editor and use it's SetParameters() function to update the min/max
values eliminating the need for the CallAfter method, however, this did
not seem to work either; what is the preferred method to modify a behavior
of a cell editor??

Thanks,

	Ron





More information about the wxpython-users mailing list