[webkit-help] How to resize NSTextView according to its content?

tonikitoo (Antonio Gomes) tonikitoo at gmail.com
Thu Apr 29 06:05:32 PDT 2010


It seems you want something like resizesToContents property of
QGraphicsWebView. See its docs:

    \property QGraphicsWebView::resizesToContents
    \brief whether the size of the QGraphicsWebView and its viewport
changes to match the contents size
    \since 4.7

    If this property is set, the QGraphicsWebView will automatically change its
    size to match the size of the main frame contents. As a result the
top level frame
    will never have scrollbars. It will also make CSS fixed
positioning to behave like absolute positioning
    with elements positioned relative to the document instead of the viewport.

Not sure if that is available on Mac port, but if you are brave
enough, you can get that in tree! :)

On Tue, Apr 20, 2010 at 12:25 PM, Devarshi Kulshreshtha
<devarshi at keyss.in> wrote:
> Hi all,
>
> I want to set simple html contents within a web view and then resize it
> according to its content.
>
> To set simple html contents within web view I used this code and it is
> working fine:
>
> [[myWebView mainFrame] loadHTMLString:webViewContents
> baseURL:baseURLFramed];
>
> Right now, if content is more than its actual size then it appears in web
> view showing both vertical and horizontal scroller in it. I want to set some
> default width and manage height according to its content in a way so that
> neither horizontal nor vertical scroller appears.
>
> Can anyone suggest me some solution for it?
>
> Thanks,
>
> Decoder
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>



-- 
--Antonio Gomes


More information about the webkit-help mailing list