segfault when reattaching a tree model to a tree view
Peter Groves <[email protected]> Mon, 13 Sep 2010 20:56:58 -0500
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm trying to speed up a tree view using the hints in the tutorial
found here:
http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/treeview-tutorial/ch03s03.html#sec-treestore-adding-many-rows
My problem is slightly different than the one described in the
tutorial, however. I'm not replacing rows in the table but just
changing the values in a single column. The column is booleans in the
model and "cell_renderer_toggle" in the view, which basically means
that one of the columns in the table contains a checkbox for every row.
The slow performance occurs when I try to set the values of all the
checkboxes in a batch. I have also tried disabling sorting, but that
did not seem to make any difference.
So now I'm trying to detach the model from the view while I do the
batch update, then reattach them. I'm able to detach the model from the
view using:
- self.treeView#set_model None;
- Then I update the model by using an 'iter' over all the rows in the
model.
- Finally, I try to replace the model with:
self.treeView#set_model (Some(self.treeModel#coerce));
It segFaults on the last step. Are there any suggestions for what might
be going wrong or any way to debug this?
Thanks,
Peter