• 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
Moving a subview within a view.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Moving a subview within a view.
      • From: p3consulting <email@hidden>
  • Prev by Date: Re: getting a plist into a dictionary?
  • Next by Date: Re: Developing for 10.3
  • Previous by thread: Re: getting a plist into a dictionary?
  • Next by thread: Re: Moving a subview within a view.
  • Index(es):
    • Date
    • Thread