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 PROTECTED]
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to