Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Ghosts for transparent NSView's

Ghosts for transparent NSView's
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Dec 28, 2001, 12:08 AM
 
This is a problem that's been bugging me for a while. I have a borderless window with a cear background and transparent content view. Whenever I change what ever is drawn in my content view, "ghosts" of old drawings is left behind. Does anyone know why this is happening and how to fix it? It goes away when I drag my window, so I though flushing it would fic the problem, but no dice so far.

Thanks in advance,
F-bacher
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Dec 29, 2001, 01:08 PM
 
Does this mean nobody knows, nobody cares, or nobody likes me?

F-bacher
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Dec 30, 2001, 05:03 AM
 
What backing store type are you using? If you're not, try using NSBackingStoreBuffered
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Dec 31, 2001, 11:08 AM
 
No, I'm setting it to 2, so that's not the issue. Here's some sample code that illustrates the problem:
http://www.students.uiuc.edu/~fahrenba/GhostProblem.tgz

Thanks,
F-bacher
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Dec 31, 2001, 01:53 PM
 
Odd... Looks like a bug to me. File a radar on it
     
Junior Member
Join Date: Dec 2000
Location: Boston, MA USA
Status: Offline
Reply With Quote
Dec 31, 2001, 10:07 PM
 
Haven't taken a look at the symptoms but it sounds like you haven't told Quartz the window is translucent. Try adding this line of code sometime after you open the window:

[window setOpaque:NO];

Like I said I haven't seen your code, so if you did this just disregard this post!

- Ross
     
Junior Member
Join Date: Dec 2000
Location: Boston, MA USA
Status: Offline
Reply With Quote
Dec 31, 2001, 10:15 PM
 
Sorry that was the wrong fix. Just got the code, and this is what you want to do:

Add the following code at the end of drawRect of the view subclass:

[[self window] setHasShadow:NO];
[[self window] setHasShadow:YES];

This is a documented bug. It's not really a bug, you just have to tell Quartz to redraw the window's shadow.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Jan 1, 2002, 01:23 PM
 
THANK YOU THANK YOU THANK YOU!

I thought it might have something to do with the shadow, but I didn't think to toggle it.

Thanks a ton!
F-bacher
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:24 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2