Re: Problems manually scrolling a view using mouseDown:
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