[haiku-development] Re: ColumnListView.h

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 12 Jan 2012 11:55:31 +0100

Stephan Aßmus wrote:
> Am 11.01.2012 14:43, schrieb Ingo Weinhold:
> > On 2012-01-11 at 11:16:27 [+0100], Axel Dörfler<axeld@xxxxxxxxxxxxxxxx>
> > wrote:
> >> Stephan Aßmus<superstippi@xxxxxx> wrote:
> >>> Actually, in practice one usually wants a mix of weighted widths and
> >>> fixed widths.
> >
> > I don't recall having seen any table/column list API that does a weighted
> > column width layout. They require the API user to specify a width for each
> > column (respectively use some default) and they provide some method to
> > explicitly set a column to the minimum width to fit all cells in it. I
> > believe resizing the view usually doesn't resize any column (or only the
> > last). That doesn't mean that we can't implement a weighted column layout,
> > but I suppose there's a reason why no one else does.
> 
> SWT most certainly offers this feature. IIRC, Nautilus behaves so that I 
> think GTK offers it as well.

I didn't spot anything related in the GTK API documentation, but I'm not really 
familiar with GTK, so I just might have missed it. Anyway, obviously it is also 
possible to implement any kind of column resizing strategy in your application.

> Generally wouldn't it be a likely situation 
> that one can make good use of any extra space in certain columns while 
> others should have a fixed width?

Normally a column has an optimal width -- the minimum width at which all of its 
cells are fully visible -- and making it wider is not beneficial. If one or 
more columns are smaller than that, things are not really straight-forward. 
When enlarging the table (e.g. by resizing the window), those columns could be 
enlarged, but when shrinking the table one might rather want to show a 
horizontal scroll bar. As I wrote earlier, I haven't seen provisions for a 
resizing strategy in any of the popular tool kits I've looked at (Qt, Swing, 
GTK), but we certainly could add something in our implementation, if it can be 
done in a way that makes sense.

CU, Ingo


Other related posts: