• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OutlineView with big text editor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: OutlineView with big text editor [SOLVED]
      • From: Leonardo <email@hidden>
    • Re: OutlineView with big text editor
      • From: Leonardo <email@hidden>
References: 
 >OutlineView with big text editor (From: "gMail.com" <email@hidden>)

  • Prev by Date: Organize a file
  • Next by Date: QTKit Exception
  • Previous by thread: OutlineView with big text editor
  • Next by thread: Re: OutlineView with big text editor
  • Index(es):
    • Date
    • Thread