Interestingly enough, I have in the past found it necessary to
provoke a WebView to update. In my case I found mouse-moved events
did the trick, but perhaps the gist of what I'm doing will serve as a
model for how you might fake a mouse click? I had to surgically
extract the source below from my project, but hopefully it's still
functional. In my case I know the size of the view, so it's just
hardcoded to 100,100, but you can change that.
I assume you can create and send an NSEvent even if you're a Carbon
app at heart. If the idea is just to convince the WebView...
// Owning window will be nil if the view is hidden, say, in another
tab ...
if (owningWindow != nil)
{
// Fake a position 100, 100 into the web view
NSPoint moveLocation = [_myWebKitView
convertPoint:NSMakePoint(100, 100) toView:nil];
// It seems that one mousemoved event is not always enough
to get the contents updated,
// but three seems to do the trick, even if it's the same
darned thing sent repeatedly...
[_myWebKitView mouseMoved:fakeMouseMoved];
[_myWebKitView mouseMoved:fakeMouseMoved];
[_myWebKitView mouseMoved:fakeMouseMoved];
}
Hope this helps,
Daniel
On Oct 30, 2005, at 4:59 PM, Chilton Webb wrote:
Hi,
I have a Carbon app with one window with WebKit content created
from a Cocoa plug-in. However, the WebKit content in it is not
always responsive when the app is brought to the foreground. The
window it's in is in the foreground, though.
A click in the center of the window fixes the problem. Until I have
more time to explore why this is, what's the easiest way to
simulate or pass a click to that window?
Thanks,
-Chilton
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden