On Jun 18, 2008, at 8:25 PM, Steve Nicholson wrote:
I have an NSTextField on my window that is neither editable nor selectable. Is there a way for my window controller to be notified when the user double-clicks on the field?

I don't know if there's a better way, but this works:

NSTextField doesn't have a doubleAction, but NSMatrix does. So instead of an NSTextField, use an NSMatrix with just one cell. You can do this in IB by selecting the NSTextField and selecting Layout >> Embed Objects In >> Matrix from the menu. In your window controller's awakeFromNib, do this:

    [_textFieldMatrix setTarget:self];
[_textFieldMatrix setDoubleAction:@selector(doTextFieldDoubleClick:)];

--Andy

_______________________________________________

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