• 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
Having trouble with NSView setNeedsDisplay
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Having trouble with NSView setNeedsDisplay


  • Subject: Having trouble with NSView setNeedsDisplay
  • From: email@hidden
  • Date: Fri, 23 Nov 2007 18:27:32 +0900

Hi, all.
I am trying to add an NSView (view) on an NSWindow (window) but I'm having
a trouble with setNeedsDisplay of NSView.


In a method, I add a view to a window's contentView, then call setFrame: display.
The view is displayed when the method is called for the first time, but it is not
displayed next time the same method is called.


I checked [view needsDispay] in the method and as it was NO when the view was
not displayed, I added [view setNeedsDisplay: YES].


But what was strange was [view needsDisplay] was still NO even after
[view setNeedsDisplay: YES] was added.

BOOL beforeSet = [view needsDisplay];
[view setNeedsDisplay: YES];
BOOL afterSet = [view needsDisplay];

I added above code in the method to see if [view needsDisplay] changed,
and both beforeSet and afterSet were NO.

There is no code between the lines so [view setNeedsDisplay: YES] seems
not to be working as I expect, but in what case does this happen and how
can I set needsDisplay YES?

The view is connected to an NSView in nib file. As it is displayed when
the method is called for the first time, it is correctly connected.

Thank you.

- Chataka

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Having trouble with NSView setNeedsDisplay
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: Finding the height of a piece of text
  • Next by Date: Re: replacing NSViewAnimation with CoreAnimation
  • Previous by thread: Re: NSOpenGLView - forcing an update.
  • Next by thread: Re: Having trouble with NSView setNeedsDisplay
  • Index(es):
    • Date
    • Thread