Re: OutlineView with big text editor
Re: OutlineView with big text editor
- Subject: Re: OutlineView with big text editor
- From: Patrick Mau <email@hidden>
- Date: Sun, 28 Nov 2010 02:35:05 +0100
On 27.11.2010, at 15:43, gMail.com wrote:
> Hi, I have set a custom cell showing icon + text on my outlineView column.
> It works well, but whenever I double click on the row to edit the text, I
> get a text field editor bigger than the cell itself and covering the left
> icon. How can I make this text field editor fit the cell bounds and not
> covering the left icon?
Hi Leo
Your NSCell implementation should implement something like the following.
In 'editWithFrame:...' you have to account for your image size and adjust
the cell frame before calling super.
(Copied from a custom cell code, but typed in mail to give you the idea)
- (void)editWithFrame:(NSRect)r inView:(NSView *)controlView editor:(NSText *)textObj
delegate:(id)anObject event:(NSEvent *)theEvent
{
// Adjust the cell frame to not cover the image
r.origin.x += imageWidth;
r.size.width -= imageWidth;
[super editWithFrame:r inView:controlView editor:textObj delegate:anObject event:theEvent];
}
Patrick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden