• 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
setNeedsDisplay oddity?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setNeedsDisplay oddity?


  • Subject: setNeedsDisplay oddity?
  • From: Timothy Reaves <email@hidden>
  • Date: Sat, 10 Dec 2005 15:55:47 -0500

Hello.

I just spent some time trouble shooting a problem I had with a custom NSView. This view allowed the user to add and remove sub- views. When sub-views were added, the view displayed correctly. When sub-views were removed, the view almost displayed correctly.

What would happen is that the sub-views were added to the custom view from bottom to top, with the sub-views moving up one position to make room for the new sub-view. When one was removed, it was removed from the bottom, and the sub-views would slide down. The top sub- view would slide down correctly, but a 'ghost' sub-view was left in the original location. It was the same sub-view, but the controls on it were non-interactive.

I was calling setNeedsDispaly:YES on the custom view. To worked great for adding sub-views to the custom view. But not for removing them. What I ended up doing was calling setNeedsDisplay:YES on the custom views superView.

So my question is, why is it that when the custom view's size increases, the superView sees this and knows that it must redraw itself also, but when the custom view is made smaller, the superView does not see that it needs to redraw itself?

Thanks.
_______________________________________________
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: setNeedsDisplay oddity?
      • From: "jeffrey.w.lynch" <email@hidden>
  • Prev by Date: Re: NSOpenGLView 'moves up' on window resize
  • Next by Date: CoreData: The NSManagedObject with ID:... has been invalidated
  • Previous by thread: Re: [Solved] Custom NSPopUpButton and Cell
  • Next by thread: Re: setNeedsDisplay oddity?
  • Index(es):
    • Date
    • Thread