Re: Getting double-clicks on NSTextField
Re: Getting double-clicks on NSTextField
- Subject: Re: Getting double-clicks on NSTextField
- From: Andy Lee <email@hidden>
- Date: Wed, 18 Jun 2008 21:04:49 -0400
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 (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