RE: Vertically centering the disclosure triangle in and outline view subclass cell
RE: Vertically centering the disclosure triangle in and outline view subclass cell
- Subject: RE: Vertically centering the disclosure triangle in and outline view subclass cell
- From: Keith Blount <email@hidden>
- Date: Mon, 14 Feb 2005 12:07:23 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
First: sorry to both have two questions on the go at
the moment and also to reply to my own quesiton... I
put the other view I was working on to one side to
give it a rest and do something I thought would be
easy - duh.
I am still struggling to get my NSOutlineView subclass
to look like the one in Mail.app, with some rows
bigger than others. I have got it so that the rows can
be different heights (will some drawing glitches that
still need ironing out), but the main problem is still
that the disclosure triangle on the left is always at
the top of the cell, not vertically centered.
I found this delegate method that I thought might
help:
- (void)outlineView:(NSOutlineView *)ov
willDisplayOutlineCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
Using this, I can see that cell's size is always
[outlineView rowHeight] - intercellSpacing - even
though I have overridden the frameOfCellAtColumn:row
method to return different cell heights...
Is there anyway I can resize the outline cell (an
NSButtonCell) in the delegate method?
It seems that the outlineView is calling the rowHeight
method from a method that I haven't subclassed, and
yet I have subclassed everything dealing with row
heights...
If anyone has any suggestions, I would be very
grateful.
Many thanks,
Keith
Hello,
I am trying to create an outline view similar to the
one in Mail.app, so that some rows are larger than
others. I have achieved this by subclassing
NSOutlineView and overriding the height calculation
methods such as rectOfRow: and
frameOfCellAtColumn:row: etc. So far, so good - I can
make some rows 32 pixels high and others 16 pixels
high, just as in Mail.app.
I am using ImageAndTextCell from the AppKit examples
for my cell, though I have altered this class slightly
by using drawInteriorWithFrame:inView: to centre the
text in the text cell vertically.
The main problem that remains is that the disclosure
triangles are not centred vertically - they always
appear at the top of the cell, which is ugly in the
32-pixel-high cells. It seems that NSOutlineView uses
-rowHeight in some way to calculate the position of
the disclosure triangle, which obviously doesn't work
with my subclass because all of the row heights are
different - but I cannot find the method I need to
override to alter this.
Does anybody know what method I have to override/what
I need to do to make sure that the disclosure
triangles are centred vertically in my subclass?
Many thanks in advance for any help,
Keith
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.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