[wxruby-users] Segfault with GridCellChoiceEditor

Alex Fenton alex at pressure.to
Wed Jul 30 04:17:51 EDT 2008


Glen Holcomb wrote:
> Okay Alex,
>
> I've got it down to 225 lines, not short but I think it's the shortest 
> I can do without possibly trivializing the issue.  I'm going to try 
> attaching the file as it is a bit long and since I've stripped the 
> code for adding db records (for brevity's sake) I will need to attach 
> a db file as well.  I'm not sure if the list will allow attachments 
> though so if not let me know.
Thanks Glen - I ran your code with a debug build which turned up what 
looks to be the source of the error:

[Debug] 08:47:15: ../src/generic/grid.cpp(495): assert "m_control" 
failed in Show(): The wxGridCellEditor must be created first!

Further poking with the debugger suggests that what's happening is that 
somehow the editor is getting created but not correctly found when it 
comes to editing the cell. Unfortunately after an hour or two I couldn't 
get to the root of the problem.

My suggested workaround would be to dispense with GridTableBase and use 
Wx::Grid and Wx::Grid.set_editor directly to link your sequel model with 
the GUI. This may be slightly less elegant but shouldn't involve any 
more code. The samples/grid/grid.rb demonstrates this.

I've filed it as a bug on our tracker
http://rubyforge.org/tracker/index.php?func=detail&aid=21389&group_id=35&atid=218

alex


More information about the wxruby-users mailing list