RE: OutlineEdit example (outlineView:heightOfRowByItem:)
RE: OutlineEdit example (outlineView:heightOfRowByItem:)
- Subject: RE: OutlineEdit example (outlineView:heightOfRowByItem:)
- From: Keith Blount <email@hidden>
- Date: Mon, 2 May 2005 12:42:49 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hmm, still struggling with this...
In theory, you should be able to use the new variable
height delegate methods of NSOutlineView and
NSTableView to support arbitrary heights depending on
content, but I am getting some very odd drawing errors
when doing this in an editable outline view. I am
trying to add the outlineView:heightOfRowByItem:
delegate method to the new (Core Data) OutlineEdit
example, but the drawing and selection is going mad. I
have set MyDocument as the delegate and added these
delegate methods:
- (float)outlineView:(NSOutlineView *)outlineView
heightOfRowByItem:(id)item
{
NSTableColumn *tabCol = [[outlineView tableColumns]
objectAtIndex:0];
float width = [tabCol width];
NSRect r = NSMakeRect(0,0,width,1000.0);
NSCell *cell = [tabCol dataCellForRow:[outlineView
rowForItem:item]];
float height = [cell cellSizeForBounds:r].height;
if (height <= 0) height = 16.0;
return height;
}
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell forTableColumn:(NSTableColumn
*)tableColumn item:(id)item
{
[cell setWraps:YES];
}
Does anybody know how to do this, or why these methods
would be causing such weird drawing errors?
Many thanks in advance,
Keith
---ORIGINAL MESSAGE----
Hello,
My question from yesterday seems to have not made it
the list somehow, so...
I have been playing with the OutlineEdit example. I am
trying to get variable row heights (thank you Apple
for allowing table and outline views to have variable
row heights without having to subclass!) depending on
the contents. I know I can do this using the delegate
method outlineView:heightOfRowByItem:, but I have been
having problems doing this as I cannot seem to get the
string value of the note in order to call
frameOfCell... correctly. This is probably because the
example uses Core Data and bindings.
However, I have just noticed that NSOutlineView now
has a new bindings setting called "rowHeight". I tried
setting this to "contents", but got the error that
contents doesn't support coding, or some such. How do
I implement this, does anybody know? I think I may
need to start digging into Core Data right away, but
if anybody can start me off with this one simple
(hopefully) thing, I would be very grateful.
Many thanks,
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