• 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
Re: Stopping a NSView from drawing in -drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping a NSView from drawing in -drawRect


  • Subject: Re: Stopping a NSView from drawing in -drawRect
  • From: Phillip Hutchings <email@hidden>
  • Date: Sat, 7 Feb 2004 00:45:17 +1300

That's what I thought, my current code is:

- (void)drawRect:(NSRect)rect
{
NSDisableScreenUpdates();
[self lockFocus];
[bgColour set];
[NSBezierPath fillRect:rect];
[fgColour set];

[trackTextView display];
if (gotImage == YES) {
[theArtwork compositeToPoint:imagePoint operation:NSCompositeCopy];
}
[self unlockFocus];
NSEnableScreenUpdates();
}

I never call display explicitly, only setNeedsDisplay. This is in a screensaver if it makes any difference.

On 7/02/2004, at 12:21 AM, James Chen wrote:

Hi,
It's a little weird.
The Window(Context) should be double buffered by default, unless you changing it in some ways.
If not, I think this could be fixed by drawing appropriately.
Could you give us more clues about how you draw those widgets, such as NSTextView, NSImage and background?
For example, Do you sending -display to your view during your drawing or something like that?
In my opinion, you might flush the port buffer during you drawing codes.
Hope this helps,
James

--
Phillip Hutchings
email@hidden
http://www.sitharus.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Stopping a NSView from drawing in -drawRect
      • From: Troy Stephens <email@hidden>
    • Re: Stopping a NSView from drawing in -drawRect
      • From: James Chen <email@hidden>
References: 
 >Stopping a NSView from drawing in -drawRect (From: Phillip Hutchings <email@hidden>)
 >Re: Stopping a NSView from drawing in -drawRect (From: James Chen <email@hidden>)

  • Prev by Date: Re: Stopping a NSView from drawing in -drawRect
  • Next by Date: Re: Are we still supposed to register Creator code (bundle signature) for OS X app?
  • Previous by thread: Re: Stopping a NSView from drawing in -drawRect
  • Next by thread: Re: Stopping a NSView from drawing in -drawRect
  • Index(es):
    • Date
    • Thread