Re: resizing cells with NSBrowser
Re: resizing cells with NSBrowser
- Subject: Re: resizing cells with NSBrowser
- From: Brant Vasilieff <email@hidden>
- Date: Fri, 4 Apr 2003 23:12:13 -0800
I did this same thing a couple of years ago because I wanted my own
finder like browser. It may not be the best solution, but worked
wonderfully.
NSBrowser uses one NSMatrix per column. I told the browser to use a
subclassed version that I modified to allow me to adjust the height of
the cells so I could display one large cell in the last column. Hint
as the browser stretches, it will call setSize, when you don't want to
adjust the height from your predetermined height.
use something like.
- (void)setCellSize:(NSSize)aSize
{
if (_cellHeight != 0)
aSize.height = _cellHeight;
[super setCellSize:aSize];
}
You'll have to write appropriate accessors to set _cellheight.
Another thing to keep in mind, is that you'll have to subclass the cell
too. Because you're adding one more column to the browser, you won't
be able to rely on NSCell's standard leaf status to draw the triangle,
or as we used to call them dohickey's. :) The last file, will still be
marked as not being a leaf because you still want one more matrix to
display your info in.
Perhaps their is an easier way. It would be nice if there was a
generic way to tell the browser to add a preview pane, be able to set
it's class, and have it ask that object to display the previous
column's selected item.
Hope that helps you get started.
Brant
On Thursday, April 3, 2003, at 12:30 AM,
email@hidden wrote:
>
i searched the web for this but could not find a solution.
>
so my hope lies in this list.
>
i use NSBrowser to display data in the way the finder (in column view)
>
shows files.
>
therefor the cell (subclass of NSBrowserCell) in the last column of my
>
NSBrowser should have different size.
>
unfortunately, the browser does not take the actual instance of my cell
>
(or the prototype of the corresponding NSMatrix) to calculate the size
>
but instead it uses its cellPrototype.
>
is this a bug or am i missing something?
>
is there somebody out, willing to show me a solution for this problem?
>
>
thanx in advance
>
>
wilfried reinthaler
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.