Re: Need the Why and How of mouseDragged:
Re: Need the Why and How of mouseDragged:
- Subject: Re: Need the Why and How of mouseDragged:
- From: Jerry Krinock <email@hidden>
- Date: Fri, 14 Dec 2007 07:40:30 -0800
On 2007 Dec, 13, at 11:09, Alastair Houghton wrote:
If your superclass is NSView, you don't need to forward the message
to super.
As for the -setEnabled: thing, the default behaviour is probably to
track the mouse until mouse up, but only if -enabled is YES. I can't
say I've noticed this before myself, because I don't tend to forward
-mouseDown: to super where super is a plain NSView.
Thanks, Alastair. Your explanation makes sense.
Since my object is specifically an NSControl (subclass of NSView), I
had been doing forwarding mouseDown: to super in order to get an
action sent. The solution I used is to replace
[super mouseDown:event] ;
with
[self sendAction:[self action] to:[self target]] ;
All seems to be working fine now.
_______________________________________________
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