Having trouble with NSView setNeedsDisplay
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