RE: NSOutlineView vertical cell alignments
RE: NSOutlineView vertical cell alignments
- Subject: RE: NSOutlineView vertical cell alignments
- From: Keith Blount <email@hidden>
- Date: Tue, 31 Jan 2006 08:00:45 -0800 (PST)
Oops, it turns out that changing the placement of
NSOutlineView's disclosure triangles is incredibly
easy - I had just missed the relevant delegate method.
This will keep the triangle at the top of the cell:
// Place the disclosure triangle at the top of the
cell, not at the centre
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayOutlineCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
{
[cell setImagePosition:NSImageAbove];
}
So that solves number 1), which just leaves number 2):
Does anybody know if there is a way of setting the
vertical alignment of cells in an outline view or
table view, or must I subclass them? Like I say, under
Panther, all cells were aligned to the top, but under
Tiger they are aligned to the centre. I want the old
behaviour, and I was hoping that Tiger might provide
an easier way than having to subclass every type of
cell I want to use in my outline view... I guess not.
:(
Thanks in advance,
Keith
--- ORIGINAL MESSAGE ---
Hello,
Is there still no way under Tiger to set the
alignments of cells without subclassing them? Two
linked questions on this topic:
1) I have an outline view with multiple row heights.
Because it is an outliner, it would look best if the
disclosure triangles were at the top. This is how
things were under Panther, but under Tiger, disclosure
triangles are centered vertically. Does anybody know
how I to get the disclosure triangles drawn at the top
of the view? The drawing methods for the disclosure
triangles all seem to be private, unless I've missed
something...
2) On a related note, my outline view contains text
cells and popup button cells. Given that the row
heights are determined by the cell with the most text
in it, by default all other cells have their contents
centered vertically, which looks ugly - they would
look far better aligned to the top of the cells. Do I
need to go to the effort of subclassing
NSPopUpButtonCell and NSTextFieldCell just to get the
alignment I want? It seems silly that there is *still*
no setting for vertical alignment, especially given
that the behaviour changed between Panther and Tiger,
so it shouldn't have been too hard to put a flag in
there and let developers choose between old (top
aligned) and new (centre-aligned) behaviour.
Any help much appreciated.
Thanks in advance,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden