[gtkmm] TreeView column - check column number?



I have TreeView that was built dynamically.

The problem was when I've stored columns in my STL container by values, I did it before adding to TreeModelRecord, so column index wasn't initialized properly yet. That caused the problem when I've tried to put data into TreeView, because GTKMM function

void
TreeViewColumn::add_attribute
(const Glib::PropertyProxy_Base& property,
 const TreeModelColumnBase& column)

never checks column has proper index, neither GTK functions

void
gtk_tree_view_column_add_attribute
(GtkTreeViewColumn *tree_column,
GtkCellRenderer   *cell_renderer,
const gchar       *attribute,
gint               column)

and

void
gtk_tree_view_column_cell_set_cell_data
(GtkTreeViewColumn *tree_column,
GtkTreeModel      *tree_model,
GtkTreeIter       *iter,
gboolean           is_expander,
gboolean           is_expanded)

checks cell->attributes have proper column index installed.

So, indexing array with -1 is not a good idea, I guess.

Regards,
-andrew





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]