Re: Variable Size Matrix
Re: Variable Size Matrix
- Subject: Re: Variable Size Matrix
- From: "John C. Randolph" <email@hidden>
- Date: Thu, 22 Nov 2001 14:21:43 -0800
On Thursday, November 22, 2001, at 01:31 PM, Donald Brown wrote:
I need a Matrix or table where both the column widths and row heights
may be
inconsistent (some rows will have a greater height than others).
Obviously,
neither NSMatrix nor NSTableView will work, neither of them can deal
with
variable row heights. Is there some other tool I'm missing, or do I
have to
roll my own? If the later, would it be easier to subclass NSMatrix,
NSTableView, or work from scratch?
Back in the NeXTStep days, there were a few examples of Matrix (not
NSMatrix) subclasses with variable cell sizes. IIRC, they only needed
to override -cellFrameAtRow:column:, -getRow:column:forPoint:, and
perhaps -sizeToCells to get they behavior they wanted.
I think I did this myself at some point, but I don't recall if I
subclassed Matrix or started with View. I do recall using a C array of
NXSizes to keep the list of cell sizes. The length of the list was the
greater of the number of rows or columns.
-jcr
"The problem with trying to child-proof the world, is that it makes
people neglect the far more important task of world-proofing the
child." -- Hugh Daniel