• 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
Programatically Editing and NSTokenFieldCell (Inside an NSTextView)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Programatically Editing and NSTokenFieldCell (Inside an NSTextView)


  • Subject: Programatically Editing and NSTokenFieldCell (Inside an NSTextView)
  • From: email@hidden
  • Date: Fri, 9 Nov 2007 00:44:58 +0900

Hi,

I have an NSTextField that contains a custom cell that represents attachments.
It has fulfilled the delegate method requirements for <NSTextAttachmentCell>, so now I am trying to get editing of its text to work.


I looked for some entry point to start editing and decided to use the method:

- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView: (NSView *)controlView atCharacterIndex:(NSUInteger)charIndex untilMouseUp:(BOOL)flag;

In that method, the cell calls editWithFrame: to self like so:

- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent inRect: (NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex: (NSUInteger)charIndex {
//This is just a quick test to get text editing working
[self editWithFrame:cellFrame inView:controlView editor:[[controlView window] fieldEditor:YES forObject:nil] delegate:[(NSTextView *)controlView delegate] event:theEvent];
return YES;
}


The problem is, the NSTokenFieldCell doesn't get edited.... e.g the field editor does not appear over the token field.
Additonally, I'm not sure where to call endEditing because if I click outside of the cell while its being edited.... the containing NSTextField doesn't know about the other editing that is going on... so there is no real place to call [self endEditing:]


Any pointers??
I've read the NSCell programming topics and searched forums but turned up nothing......


Andre
_______________________________________________

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: Redraw Problem with Layer-Backed View in Scroll View
  • Next by Date: Re: predicate with smallest x-coordinate?
  • Previous by thread: Re: Redraw Problem with Layer-Backed View in Scroll View
  • Next by thread: How to talk with a kernel extension?
  • Index(es):
    • Date
    • Thread