Hidden id column in TreeStore?

I’m trying to use TreeStore as an only data storage, to avoid data desynchronization and duplication issues.

However, are the set of columns in TreeStore and the set of columns in TreeView meant to match each other? Is it possible to have an id column in TreeStore that doesn’t have a representative column in TreeView? If I try to create 2 columns in TreeStore and 1 column in TreeView, I get a runtime warning IA__gtk_tree_store_set_value: assertion 'column >= 0 && column < tree_store->n_columns' failed

If not, what would be the best way to achieve invisible ids? Hide the following column in TreeView? Or probably keep a separate hash that assigns TreeIters to ids?

To your primary question, yes.

The assertion failure is indicating that you’re trying to access colum not in your treestore, either <0 which is impossible, or a column id higher than the total number actually in your treestore.

Probably you are forgetting to count up from 0.

Okay, so I made a separate hash with pointers to TreeIters. It would be useful anyway, as TreeStore seems to be very limited in terms of supported data types; for example, there is no datetime type, so dates themselves and their string representations should be stored separately.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.