owenc <[EMAIL PROTECTED]> wrote:
> I'm using gtkmozembed and I understand that it is not currently
> possible to use native scroll bars but i have another requirement that
> is related.
>
> I'd like to completely turn off scroll bars within the embedded
> browswer.  No matter how big the actual screen might be I'd like to
> only display what appears in the browser window as originally sized and
> not have it show the tool bars.
>
> Is there some way to specify this when creating the browser?  I see the
> preference GTK_MOZ_EMBED_FLAG_SCROLLBARSON but I'm not sure exactly
> what that does since scroll bars seem to always be on.

By default the scroll bars appear if and only if the content is larger
than the window.  Given a pointer to nsIWebBrowser called browser,
you can use this to hide them, though they may come back again:

    nsCOMPtr<nsIDOMWindow> dom_window;
    check(browser->GetContentDOMWindow(getter_AddRefs(dom_window)));
    nsCOMPtr<nsIDOMBarProp> dom_bar_prop;
    check(dom_window->GetScrollbars(getter_AddRefs(dom_bar_prop)));
    check(dom_bar_prop->SetVisible(false));

(I define void check(nsresult) to throw if its argument represents
an error.)

Alternately you should be able to force scroll bars off by putting
this in an agent style-sheet:

    body { overflow: hidden; }

See <http://tinyurl.com/p7dq7> or
<http://groups.google.com/group/netscape.public.mozilla.embedding/browse_thread/thread/bfb9b4ab88d9477d>
for a discussion of agent style-sheets.  The code I have ended up
using with Mozilla 1.7.x is in the source file style_sheets.cpp in
<http://womble.decadent.org.uk/software/webdvd/webdvd_0.6.tar.gz>.

Ben.

-- 
Ben Hutchings
Life is like a sewer:
what you get out of it depends on what you put into it.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to