Re: Moving a subview within a view.
Re: Moving a subview within a view.
- Subject: Re: Moving a subview within a view.
- From: p3consulting <email@hidden>
- Date: Sat, 20 Dec 2003 12:16:22 +0100
See
http://www.macosxguru.net/gadmin/story.php?
mode=edit&sid=20031219104032813
Pascal Pochet
P3 Consulting
On 18 dic. 2003, at 05:57, David Trevas wrote:
I'm working on an app with a custom view called BigView to which I add
subviews of LittleView class at runtime. I want to be able to drag
these subviews around the BigView, so I wrote mouseDown:,
mouseDragged: and mouseUp: methods for LittleView.
When the mouseDragged: method uses [self setNeedsDisplay:YES], I end
up with multiple copies of my subview smeared with the BigView.
It does better when I use [[self superview] setNeedsDisplay:YES], but
then the subview moves when it is dragged, but so does the WHOLE
window!
I tried putting [[self window] setIgnoresMouseEvents:YES] in
mouseDown: and [[self window] setIgnoresMouseEvents:YES] in mouseUp:
and I have used NSLog to verify that those methods are being at least
attempted as expected.
I've always thought that once a view handled an event, it was not
passed further, but it seems that my mouseDragged: event is being used
by the subview AND the window. How can I prevent this behavior?
Thanks.
Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.