views:

137

answers:

1

Hello,

I'm embedding WebKit in a Windows C++ Application. I'm using the Cairo port. It works fine.

I'd like to disable the scrollbars that appear when there's more data that the client area can display. Like the iPhone, the iPhone does not have scrollbars, scrolling is implemented differently.

How can I disable the scrollbars programatically, in C++ (no Javascript hacks)?


Update:

I tried to call HRESULT IWebFrame::setAllowsScrolling(BOOL flag). To get an IWebFrame interface, I called HRESULT IWebView::mainFrame(IWebFrame **frame). This doesn't seem to work. Scrollbars still appear. What am I doing wrong? Is it not the main frame my main interest here?


Update:

I tried enabling flat frame mode like this:

IWebPreferences *Preferences;
hr = pWebView->preferences(&Preferences);
if (FAILED(hr))
    goto exit;

IWebPreferencesPrivate *PrivatePreferences = 0;
hr = Preferences->QueryInterface(IID_IWebPreferencesPrivate, (void **)&PrivatePreferences);
if (FAILED(hr))
    goto exit;
hr = PrivatePreferences->setFrameSetFlatteningEnabled(TRUE);
if (FAILED(hr))
    goto exit;

The code runs fine but nothing seems to happen. What am I doing wrong here?


Update:

I've received the suggestion that I might include WS_VSCROLL when creating the main window. This is not the case:

MainWindow = CreateWindow(
    WindowClass,
    WindowTitle,
    WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT,
    0,
    iPhoneXRes + 16 + 20,
    iPhoneYres + 110,
    NULL,
    NULL,
    hInstance,
    NULL
);

Thanks,

+1  A: 

Are you rebuilding the Cairo-port of webkit ?

If so, you can modify WebCore/css/html4.css and WebCore/css/quirks.css to include the "overflow: hidden" in the body tag.

If not, I am afraid that the only way to disable scrollbar is to pass through javascript.

Xavier V.