• 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: NSTextField and NSTextAttachment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField and NSTextAttachment


  • Subject: Re: NSTextField and NSTextAttachment
  • From: Ben Lachman <email@hidden>
  • Date: Wed, 27 Feb 2008 02:10:43 -0500

I'd say the field editor is the problem. NSCell provides setAttributedStringValue: and I assume stores and displays that value as well as reacting to clicks when not editing. Once you begin editing the firstResponder is set to the field editor and your textfield becomes its delegate, so for all intents and purposes the z- order has changed. So at this point you need to deal with the field editor using the delegate methods. I'd say textView:clickedOnCell:inRect:atIndex: and friends looks promising (of course you'll need to subclass NSTextField). your other option would be to implement a custom field editor, but I think this would probably end up being a lot more work.

Hope this helps,

->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

email@hidden
740.590.0009

On Feb 26, 2008, at 11:11 PM, Sean Willson wrote:

i've created a NSTextView and placed one or more NSTextAttachment
within it that wrap controls and i'm able to get the behavior of
clicking the control etc as i want. however when i place the same
NSTextAttachment in a NSTextField via:

	[textField setAttributedStringValue:[NSAttributedString
attributedStringWithAttachment:attachment]];

it doesn't behave at all like the NSTextView. well let me extrapolate
.... it behaves the same as textview in that if i DON'T click into the
TextField but do click on the control it works fine. if i however
click into the textfield first, the control associated with the
attachment doesn't receive any mouse events after that and it's almost
as if it's not sitting in the same z-order as it is when it's in the
textview. i was wondering if anyone knew what was happening here? is
the FieldEditor getting placed above it when mousedown is performed in
the text field? is there any magic i can do to reorder it so that the
embedded control can get mouse events?
_______________________________________________

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


References: 
 >NSTextField and NSTextAttachment (From: "Sean Willson" <email@hidden>)

  • Prev by Date: Re: Observing with GC
  • Next by Date: Tracking the movement of a CAScrollLayer
  • Previous by thread: NSTextField and NSTextAttachment
  • Next by thread: Tracking the movement of a CAScrollLayer
  • Index(es):
    • Date
    • Thread