Moving a subview within a view.
Moving a subview within a view.
- Subject: Moving a subview within a view.
- From: David Trevas <email@hidden>
- Date: Wed, 17 Dec 2003 22:57:22 -0600
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.