[webkit-dev] Embedded WebView & autoscroll
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
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:
The view hierarchy of Apple Mail (when displaying an HTML mail) is:
How does Apple Mail manage to have the WebView create and use their own
subclass of WebHTMLView (the "MessageWebHTMLView") instead of a standard
Thanks a lot,
Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center.
More information about the webkit-dev