Brian J. Tarricone schrieb:
> Hi all,
> 
> I'm trying to use GtkTreeView's fixed height mode for a playlist that
> can hold thousands of items, but I'm having a bit of trouble.  All I
> seem to get is:
> 
> Gtk-CRITICAL **: gtk_tree_view_insert_column: assertion
> `gtk_tree_view_column_get_sizing (column) == GTK_TREE_VIEW_COLUMN_FIXED'
> failed
> 
> I've tried gtk_cell_renderer_text_set_fixed_height_from_font() (I have
> three columns, all text renderers), but no help there; I still get the
> above critical message.


This works for me:

gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer),1);
  if((tree_col=gtk_tree_view_column_new_with_attributes(_("Pos."),renderer,
    "text",SEQUENCE_TABLE_POS,
    "foreground-set",SEQUENCE_TABLE_TICK_FG_SET,
    NULL))
) {
  g_object_set(tree_col,
    "sizing",GTK_TREE_VIEW_COLUMN_FIXED,
    "fixed-width",40,
    NULL);
  col_index=
    gtk_tree_view_append_column(self->priv->sequence_table,tree_col);
}
else GST_WARNING("can't create treeview column");


I was initially using gtk_tree_view_insert_column_with_attributes() and
got lots of assertions too. In this case it seems to be required to
create the column, set the fixed-width and append (or insert) it.

Stefan

> 
> If I set the sizing of each column to GTK_TREE_VIEW_COLUMN_FIXED, I get
> 4500 blank rows, and only the middle column header is visible (probably
> because I set its 'expand' property to TRUE).  Not too useful.
> 
> I'm not understanding why fixed height mode has anything to do with the
> sizing mode, since (according to the docs[1]), the sizing mode is only
> used to determine the _width_ of the cell, not the height.
> 
> Can someone enlighten me here?
> 
> Thanks,
> Brian
> 
> [1] "The sizing method the column uses to determine its *width*. Please
> note that GTK_TREE_VIEW_COLUMN_AUTOSIZE are inefficient for large views,
> and can make columns appear choppy."  (emphasis mine)
> 
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to