Re: OutlineView with big text editor [SOLVED]
Re: OutlineView with big text editor [SOLVED]
- Subject: Re: OutlineView with big text editor [SOLVED]
- From: Leonardo <email@hidden>
- Date: Sun, 28 Nov 2010 23:46:26 +0100
- Thread-topic: OutlineView with big text editor [SOLVED]
I have found a solution.
I have overrided the method selectWithFrame:(NSRect)aRect inView:....
in my NSTextCell subclass. Here I modify the frame of the field editor
It works. Thanks anyway.
-- Leonardo
Da: Patrick Mau <email@hidden>
Data: Sun, 28 Nov 2010 02:35:05 +0100
A: "gMail.com" <email@hidden>
Cc: <email@hidden>
Oggetto: Re: OutlineView with big text editor
On 27.11.2010, at 15:43, gMail.com <http://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