Oh-oh. OK, 'tis as I feared then - I was living on a wing and a prayer with Leopard (which did work perfectly in this regard to my use of WebView in a layer-backed view hierarchy - i.e. at the bottom of the stack).

I took a look at WebUIDelegate (as I think I had done a long while back, while playing with how to draw over the top of web content). I can't see from the docs how to use such a delegate to draw over the web content. The delegate seems to be empowered to control a lot of the expected user interactions, but I'm not sure how you would draw with it.

BTW, I tried subclassing WebView when I was playing with it, way back, but couldn't get the subclass to draw the web content before my annotations. At the time I just called the superclass draw method and then attempted to draw the annotations. Maybe I was being too simplistic about it, and that having my own graphics context or something would have made that work.


On 2009-10-24, at 3:36 AM, Mike Abdullah wrote:

WebView's don't support being layer-backed. But there is a private WebUIDelegate method that will let you achieve what you want:

- (void)webView:(WebView *)sender didDrawRect:(NSRect)rect;

On 24 Oct 2009, at 00:53, Luke Evans wrote:

I have an app that plain stopped working between Leopard and Snow Leopard. This app relies on placing a WebView component in a Core Animation layer view hierarchy (i.e. "Needs Core Animation Layer" flag is turned on for this view and its superviews), so that I can draw annotations over the web content with a mostly-transparent 'glass view' in a layer above.

What I've found so far is that if I turn off the "Needs Layer" flag on the WebView and all its superviews, then the web content is visible. If I leave this flag on however, then all I get is a plain white area, with no web content visible (though this continues to be loaded).

I have logged this as a bug already - mostly because its a behaviour change between Leopard and Snow Leopard, and I have not found any documentation that indicate this is an intentional change. However, it _might_ be intentional, or possibly I was already flying by the seat of my pants to have it working in the first place. In any case, perhaps somebody has some concrete knowledge on the subject...?

Cheers

-- Luke


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to