Re: copy in WebView
Re: copy in WebView
- Subject: Re: copy in WebView
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sun, 14 Oct 2012 16:56:29 +0700
On 14 Oct 2012, at 16:07, Heinrich Giesen <email@hidden> wrote:
>
> On 13.10.2012, at 21:00, Kyle Sluder wrote:
>
>> Could you instead broaden your test to "my WebView or any of its
>> descendants is first responder?"
>
> or simply use directly the WebView on the responderchain. Because I had similar problems like Gerriet
> concerning finding a selected string or zooming the WebView (text only or the whole WebView including
> images) I use the following code (not using the dangerous WebHTMLView question):
>
> - (WebView *) currentRespondingWebView
> {
> id firstResponder = [[NSApp keyWindow] firstResponder];
> // let's search for a WebView in the responderchain
>
> for( id frsp=firstResponder; frsp!=nil; frsp=[frsp nextResponder] ){
> NSLog(@"frsp = %@ --> %@", [frsp class], [frsp superclass] ); // test only
> if( [frsp isKindOfClass:[WebView class]] )
> return frsp; // found a WebView
> }
>
> return nil; // no success
> }
>
> And if you have the WebView you have all you need, e.g. the selectedDOMRange.
>
> BTW the test output is:
>
> frsp = WebHTMLView --> NSControl
> frsp = WebClipView --> NSClipView
> frsp = WebDynamicScrollBarsView --> NSScrollView
> frsp = WebFrameView --> NSView
> frsp = WebView --> NSView
>
>
> Gerriet, do you remember what you wrote on Mar 24 2010 ?
> performFindPanelAction: in WebView
No, I did not.
But now, having read that old post again, some dim recollections come back.
Thanks for reminding me.
Kind regards,
Gerriet.
_______________________________________________
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