• 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: Problems manually scrolling a view using mouseDown:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems manually scrolling a view using mouseDown:


  • Subject: Re: Problems manually scrolling a view using mouseDown:
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Wed, 26 Jan 2005 06:25:53 +0100

At 13:33 Uhr -0800 24.01.2005, Matt Neuburg wrote:
On Sun, 23 Jan 2005 21:28:46 -0800, mmalcolm crawford <email@hidden>
said:
 >That document is, unfortunately, misleading (and a bug has been filed).
  You should not set up your own "mini event loop" in this way.  You
should instead capture the relevant information in mouseDown: and then
deal with updates in mouseMoved: and mouseUp:.

Okay, I'm adaptable. Here's the Damn-The-Documentation, Full-Speed-Ahead version:

- (void) mouseDown: (NSEvent*) e {
    clickPoint = [e locationInWindow];
    originalOrigin = [cv bounds].origin;
    [cv setDocumentCursor: [NSCursor openHandCursor]];
}

- (void) mouseDragged: (NSEvent*) e {
NSPoint newPoint = [e locationInWindow];
NSPoint newOrigin = NSMakePoint(originalOrigin.x, originalOrigin.y +
(clickPoint.y - newPoint.y));
[cv scrollToPoint: [cv constrainScrollPoint: newOrigin]];
[sv reflectScrolledClipView: cv];
}
- (void) mouseUp: (NSEvent*) e {
[cv setDocumentCursor: nil];
}

What happens when the mouse moves out of the view during dragging? -- Cheers, M. Uli Kusterer ------------------------------------------------------------ "The Witnesses of TeachText are everywhere..." http://www.zathras.de _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Problems manually scrolling a view using mouseDown:
      • From: mmalcolm crawford <email@hidden>
References: 
 >Re: Problems manually scrolling a view using mouseDown: (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: iSync-like toolbar and scrolling
  • Next by Date: Re: Mixing Objective C and C++
  • Previous by thread: Re: Problems manually scrolling a view using mouseDown:
  • Next by thread: Re: Problems manually scrolling a view using mouseDown:
  • Index(es):
    • Date
    • Thread