• 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
Problem positioning the field editor for outline view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem positioning the field editor for outline view


  • Subject: Problem positioning the field editor for outline view
  • From: Gideon King <email@hidden>
  • Date: Mon, 27 Sep 2010 02:08:19 +1000

Hi, I have an outline view which uses variable row heights, and need to resize and position the field editor as the user edits the text. My code in my outline view is as follows:

- (void)textDidChange:(NSNotification *)aNotification {
	NSInteger editedRow = [self editedRow];
	if (editedRow > -1) {
		[self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndex:editedRow]];
		NSTextView *editor = (NSTextView *)[[self window] fieldEditor:NO forObject:self];
		NSRect newRect = [self frameOfCellAtColumn:[self editedColumn] row:editedRow];
		[editor setFrame:newRect];
	}

	[super textDidChange:aNotification];
}

I have confirmed that the editor is an object of the expected class (a subclass of NSTextView, but I have also checked with NSTextView), so as far as I can tell, it is the actual text editor.

No matter what I do, it doesn't update the frame of the editor. When the editor wraps to the next row, it draws the cell the right size but the editor only covers the top line of the cell.

I can't help thinking I must be missing something obvious here, but haven't been able to find it. Any suggestions?

Thanks

Gideon








_______________________________________________

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

  • Prev by Date: Table column alignment
  • Next by Date: Selection of object in popup button
  • Previous by thread: Re: Table column alignment
  • Next by thread: Selection of object in popup button
  • Index(es):
    • Date
    • Thread