GtkTreeViewColumn - width handling broken?



I want to be able to find the width of the columns in my GtkTreeView (i.e
the width required to display the full text in each cell in the column).
The obvious thing would be to use gtk_tree_view_column_get_width(column).
But it doesn't work, it only returns 0.

Likewise gtk_tree_view_column_get_fixed_width(column) returns 0 (which isn't
so surprising since fixed width isn't the same as actual width), and the
property "width" also returns 0.

Does this mean there is a bad bug in gtk_tree_view_column_get_width()?  It
 shouldn't be returning 0, surely?

The best I've been able to do is to fudge the width by using the cell width
from gtk_tree_view_column_cell_get_size(..), but it's unsatisfactory since
it does not get automatically updated when the data in the model is changed.

I might have to manually read through all rows in the column instead, and
estimate the width based on the largest cell ;(

Does anyone have a better idea, or an explanation why
gtk_tree_view_column_get_width(..) isn't working?

Drew

-- 
PGP public key available at http://people.debian.org/~dparsons/drewskey.txt
Fingerprint: A110 EAE1 D7D2 8076 5FE0  EC0A B6CE 7041 6412 4E4A



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