• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Missing Mouse Events in PDFView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing Mouse Events in PDFView


  • Subject: Re: Missing Mouse Events in PDFView
  • From: Robert Clair <email@hidden>
  • Date: Wed, 31 Oct 2007 17:25:05 -0400


Really? Outside of things like buttons, that's an unfortunate choice, isn't it? As the "Cocoa Event-Handling Guide" points out, a class that handles dragging in this manner is "more difficult to extend without the subclass reimplementing all the dragging code".

Absolutely. I don't use PDFView but I had to do some unpleasant things when sub-classing NSTextView (which behaves the same way). I was under the impression that this was a NextStep holdover and that new things wouldn't do it.



It turns out that, for tracking in any event, a lot of state has to be
kept (instance vars) in order to handle dragging or tracking across
the three event flavors.

So? So keep it. What is the problem? If you're worried about the allocated size of the object, put your state information in a struct and allocate it on mouseDown and free it on mouseUp. That way you only increase the size of the object by a few bytes. The other way really limits the usefulness of the object because you can't subclass it properly. (Not to mention confusing beginners who look at the docs, see a subclass of NSResponder and wonder why their methods never get called.)


Robert Clair


_______________________________________________

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


  • Prev by Date: Create NSImage from array of integers
  • Next by Date: URL Encoding
  • Previous by thread: Re: Missing Mouse Events in PDFView
  • Next by thread: 10.5 + Core Data project error?
  • Index(es):
    • Date
    • Thread