Re: drawRect not getting called when needed under OS X
Re: drawRect not getting called when needed under OS X
- Subject: Re: drawRect not getting called when needed under OS X
- From: Graham Cox <email@hidden>
- Date: Sun, 24 Jul 2011 14:06:46 +1000
On 24/07/2011, at 1:46 PM, Tom Jeffries wrote:
> 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.
Show your code.
You don't call drawRect: - the framework does. You can tell the framework it needs to be called by calling the view's -setNeedsDisplay: method. Are you doing that?
How does the button come into it? How are you responding to the button? That's the trouble - what you've said so far is far too vague, it could be a thousand different things (but probably something simple).
--Graham
_______________________________________________
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