• 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
drawRect not getting called when needed under OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drawRect not getting called when needed under OS X


  • Subject: drawRect not getting called when needed under OS X
  • From: Tom Jeffries <email@hidden>
  • Date: Sat, 23 Jul 2011 20:46:30 -0700

I am using a window that uses a subclass of NSView. Part of it is drawn when
the program starts, another part needs to be drawn when the user clicks on a
button in another window. The code for the other window calls my subclass of
NSView with no problems, creates the new graphics, and then returns.
However, the window that needs to get updated with new graphics does not
change.

When I put both the beginning graphics and the graphics that are to be drawn
later in the initial drawRect call everything is drawn without a problem.
However, drawRect does not get called when the user clicks the button on the
second window. I've tried awakeFromNib, setNeedsDisplay, needsDisplay, and
display, but nothing I've found so far gets the NSView window to call
drawRect.

I am fairly new to OS X programming and appreciate any hints you can throw
my way.

Thanks, Tom Jeffries
_______________________________________________

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: drawRect not getting called when needed under OS X
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Cocoa-dev Digest, Vol 8, Issue 553
  • Next by Date: Re: drawRect not getting called when needed under OS X
  • Previous by thread: Re: Cocoa-dev Digest, Vol 8, Issue 553
  • Next by thread: Re: drawRect not getting called when needed under OS X
  • Index(es):
    • Date
    • Thread