• 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: mmalcolm crawford <email@hidden>
  • Date: Sun, 23 Jan 2005 21:28:46 -0800


On Jan 23, 2005, at 9:15 PM, Matt Neuburg wrote:

(2) You exit the event loop prematurely, instead of generating your own
event loop during the drag, as explained in the helpful document "Handling
Mouse Events in Views".
[...]
- (void) mouseDown: (NSEvent*) e {
NSScrollView* sv = [self enclosingScrollView];
NSClipView* cv = [sv contentView];
[[NSCursor openHandCursor] push];
clickPoint = [e locationInWindow];
originalOrigin = [cv bounds].origin;
{
BOOL keepOn = YES;
while (keepOn) {
NSEvent* theEvent = [[self window] nextEventMatchingMask:
NSLeftMouseUpMask | NSLeftMouseDraggedMask];


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:.

mmalc


_______________________________________________ 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: glenn andreas <email@hidden>
References: 
 >Re: Problems manually scrolling a view using mouseDown: (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Problems manually scrolling a view using mouseDown:
  • Next by Date: Re: Problem reloading data for NSOutlineViewDataSource without memory leak
  • 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