GtkTreeView: speed optimization with display problems
- From: Razvan Gavril <razvan gavril gmail com>
- To: gtk-app-devel-list gnome org
- Subject: GtkTreeView: speed optimization with display problems
- Date: Mon, 12 Sep 2005 12:09:00 +0300
In the search of optimizing the code i have written to populate a treeview,
I've stumbled to the following problems:
The insertion (>1000 rows) in the treemodel i get it to be blazing fast but
when i attach/reattach the model to the view there is a big delay before the
display is drawn/redrawn (about 0.5 sec). This problem is not from my code,
is gtk's fault, but that isn't a excuse to tell the users of my software,
isn't it ? So i have to do some future optimizations so i could get a
application to respond much faster, so the delay between attaching the
model, and gtk drawing the view to be acceptable.
Reading the gtk tree view api, i found this function :
gtk_tree_view_set_fixed_height_mode ().
Enables or disables the fixed height mode of *tree_view*. Fixed height
mode speeds up GtkTreeView<file:///usr/share/gtk-doc/html/gtk/GtkTreeView.html>by assuming that all rows
have the same height. Only enable this option if
all rows are the same height and all columns are of type
GTK_TREE_VIEW_COLUMN_FIXED.
Ok so this is great, it gives me the speed bust that i wanted, all the rows
of my treeview are the same height, but ... the GTK_TREE_VIEW_COLUMN_FIXED
freaks me out, i don't want that :(, it messes out with my view real bad,
I'll explain why:
I have X columns, for the first column i set it's `expand` property to
`true` so it can expand and all the X-1 columns stand on the right of the
view. You can take a look at this picture to see what i mean:
http://www.linux360.ro/forum/album_pic.php?pic_id=1318 ( `File` is expanded,
`Size` and `Date` are on the right side). If i set the sizing of the columns
to GTK_TREE_VIEW_COLUMN_FIXED, the first column (`File` in the picture)
expands and covers all the other columns, to be more precise : first column
gets all the treeview width, the other X-1 columns are set to 0 width. I
could use gtk_tree_view_column_set_min_width() to this column so they won't
be 0 sized, but this is't a valid option as i the min size that i wants
depends on the font size and other parameters that i can't know.
My question: is there a way to use gtk_tree_view_set_fixed_height_mode(),
without setting the sizing of the columns to GTK_TREE_VIEW_COLUMN_FIXED, or
is there a way to get rid of the 0 width behavior.
--
Razvan Gavril
razvan gavril gmail com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]