• 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: Custom View drawn twice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom View drawn twice?


  • Subject: Re: Custom View drawn twice?
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 14 Mar 2008 13:34:42 +0100

On 14.03.2008, at 09:11, Ben Lachman wrote:
I think I finally solved this while chatting with Wil Shipley earlier this evening. Wil mentioned sometimes needing to display from the opaque ancestor which is basically what I was trying to do with the code Uli questioned. The way I was doing it was only partially successful at best. Given Wil's hints, I added the following to my drawing code and my drawing glitches are no more:

- (void)drawRect:(NSRect)rect {
	static BOOL toggle = YES;

	if( toggle ) {
		toggle = NO;
		[[self opaqueAncestor] display];
		return;
	} else {
		toggle = YES;
	}
...


I think you're supposed to call display outside of drawRect, not inside. What you're doing here is requesting the OS to draw everything twice, once with toggle YES, once with toggle NO. Only your view doesn't draw as long as toggle is YES.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

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


References: 
 >Re: Custom View drawn twice? (From: Uli Kusterer <email@hidden>)
 >Re: Custom View drawn twice? (From: Ben Lachman <email@hidden>)
 >Re: Custom View drawn twice? (From: Ben Lachman <email@hidden>)

  • Prev by Date: Re: Custom View drawn twice?
  • Next by Date: Re: Custom View drawn twice?
  • Previous by thread: Re: Custom View drawn twice?
  • Next by thread: NSString and string contains
  • Index(es):
    • Date
    • Thread