[webkit-dev] Embedded WebView & autoscroll

piet piet.webkit at yahoo.com
Mon Aug 13 15:21:57 PDT 2007


I need help!

What I'm trying to do is very similar to the Message Pane in the Apple Mail
application, ie. put a WebView together with one other view into a
NSScrollView. In the case of Apple Mail, the WebView displays HTML messages,
the other view displays the message headers, and a single set of scrollbars
make them scroll both at the same time.

To do so, I have a TilingView that contains a NSBoxView and a WebView. The
WebView doesn't have scrollbars: instead, it adjusts its size to the size of
the HTML document. The TilingView listens to
NSViewFrameDidChangeNotification, adjusts its size to the size of the
WebView, makes additional space for the NSBoxView, and is included into a
NSScrollView.

All that works fine as long as I'm using the scrollbars of my NSScrollView:
the NSBoxView and the WebView scroll together and allow to see the entire
document, and the scrollbars are shown/hidden correctly if the NSScrollView
is large enough to display both views simultaneously.

The problem is: auto-scroll does not work. When I click into the WebView,
the mouseDown event is captured and handled by the WebView, and is not
propagated up the view hierarchy into my NSScrollView.

What can I do to make the TilingView auto-scroll inside the NSScrollView?

---

Here are more details to put you on track maybe...

The view hierarchy of my application, as displayed by F-Script, is:
    WebHTMLView
    WebClipView
    WebDynamicScrollBarsView
    WebFrameView
    WebView
    MyTilingView
    NSClipView
    NSScrollView
    MyComposedView
    etc...

The view hierarchy of Apple Mail (when displaying an HTML mail) is:
    MessageWebHTMLView
    WebClipView
    WebDynamicScrollBarsView
    WebFrameView
    MessageWebView
    TilingView
    NSClipView
    NSScrollView
    ColorBackgroundView
    etc...

How does Apple Mail manage to have the WebView create and use their own
subclass of WebHTMLView (the "MessageWebHTMLView") instead of a standard
WebHTMLView? 

Thanks a lot,
Piet



      ____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 



More information about the webkit-dev mailing list