Re: GtkTreeView and fixed_height mode

2007-02-13 Thread Kristian Rietveld
On Wed, Feb 07, 2007 at 03:37:07PM +0100, Emmanuel Briot wrote:
 I do agree with your analysis that the other modes do not make sense, but if 
 things work anyway shouldn't it just be documented that best practice 
 recommend using fixed width mode, but have the code not enforce it ?

Maybe, I am not really sure about that.

  Fixed height mode is really limited and we have always discouraged to
  use it.  However, for really large data sets there is not really another
  option.
 
 Are there any other limitations that not having things resize automatically ? 

Not that I know of, but of course from the name it is clear that all
rows in the tree view will be forced to have the same height.  It is not
possible to have both rows with a single line of text and multiple lines
of text, etc, etc.


regards,

-kris.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkTreeView and fixed_height mode

2007-02-13 Thread Kristian Rietveld
On Wed, Feb 07, 2007 at 10:06:13AM -0500, Morten Welinder wrote:
 You would measure cells only as they become visible and adjust the width
 of the columns as needed.

That would probably mean that the columns will be busy resizing as you
are scrolling.  I am not sure if that is really nice ...


regards,

-kris.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkTreeView and fixed_height mode

2007-02-13 Thread Soeren Sandmann
Morten Welinder [EMAIL PROTECTED] writes:

 That depends on the data and how much we have seen before, but if
 we initially did a fair-sized sample -- last I looked we were doing 1000
 rows -- then the probability is low and hence it is not annoying.

If you did that, then you could also completely avoid having the
fixed-height mode by estimating the total height based on the initial
sampling, then adjusting the scrollbar as needed. If the distribution
of heights is reasonable, then the initial guess will be close to
the correct one. In the common case where all rows have the same size,
the initial guess would be exact.

This is particularly appealing since programmers in general don't have
the information to answer the question is this tree fixed height,
because the answer depends on what fonts are installed and what text
is actually in the tree.


Soren
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkTreeView and fixed_height mode

2007-02-07 Thread Kristian Rietveld
On Wed, Feb 07, 2007 at 12:58:18PM +0100, Emmanuel Briot wrote:
 The assertion above checks that all columns are also using a fixed sizing. 
 The 
 comment doesn't really indicate *why* this was necessary though, and that is 
 change compared to older versions of gtk+ 2.4.

Note that this change has been in gtktreeview.c since the first
fixed_height_mode commit.  The requirement for FIXED columns in fixed
height mode has been in there since 2.3.x and has not changed over
time.

 I suppose changing their code to using fixed sizing for columns is doable, 
 but 
 what would they lose by doing that (is manual resizing an orthogonal issue 
 for instance ?)

Which other resizing mode would you want to use for your column?
AUTOSIZE doesn't make any sense, the point of fixed height mode is to
speed up GtkTreeView by not measuring every row.  Widths of cells will
also not be measured, so GtkTreeView cannot auto size columns in this
case.

Then there is GROW_ONLY; as cells are not remeasured on model changes,
using this mode does not make much sense either.

The only one left is FIXED.  GtkTreeView usually defaults to the size of
the column headers (determined by the length of the column titles) for
this.  You can also set a good size yourself.  And the user is still able
to resize columns when you enable the resizable properties of the columns.

Fixed height mode is really limited and we have always discouraged to
use it.  However, for really large data sets there is not really another
option.

I hope this clears things up a bit.


regards,

-kris.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkTreeView and fixed_height mode

2007-02-07 Thread Morten Welinder
 Which other resizing mode would you want to use for your column?
 AUTOSIZE doesn't make any sense, the point of fixed height mode is to
 speed up GtkTreeView by not measuring every row.

AUTOSIZE.  Or maybe GROW_ONLY.

You would measure cells only as they become visible and adjust the width
of the columns as needed.

Morten
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list