Re: Getting double-clicks on NSTextField
Re: Getting double-clicks on NSTextField
- Subject: Re: Getting double-clicks on NSTextField
- From: Steve Nicholson <email@hidden>
- Date: Sun, 22 Jun 2008 00:32:46 -0700
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?
On Jun 18, 2008, at 6:04 PM, Andy Lee wrote:
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
Thanks. That worked a treat.
-Steve
_______________________________________________
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