Re: problem with gtk_tree_view_set_fixed_height_mode()



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/4/2005 5:07 AM, Stefan Kost wrote:
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.

That sounds kinda icky.  Where are you getting the value of '40' for the
 'fixed-width' parameter?  Just making it up?

Unfortunately, I *can't* use fixed-width columns, as the user needs to
be free to resize the containing window (and the treeview should resize
to match, with the middle column growing or shrinking as necessary).  I
still don't understand why GtkTreeView requires a fixed *width* column
in order to enable fixed *height* mode.

        -brian



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


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFDQwAf6XyW6VEeAnsRAr7AAJ4uFL60XMTaU7Q4ShYbtCEaHQJpAQCgmRER
VmIVtO2Kf2RqddvDRZIcxaE=
=dzr9
-----END PGP SIGNATURE-----



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