El Thu, 14 Jul 2011 04:38:20 +0000 (UTC) biswa <[email protected]> escribió: > Gavin Lambert <gavinl@...> writes: > Hello, > The displayed page I checked with is smaller than the widget and > theres nothing to scroll on the page.However the scroll bars still > appear. > > In webkit(not webkit2) the problem as was discussed previously in > this forum is a bit different. There, if i create a scroll widget, > then set the scroll policy to GTK_POLICY_NEVER and add a webview to > the scroll widget, still the scroll bars appear.
In WebKit1, WebKitWebView implements GtkScrollable and you are supposed to use it inside a GtkScrolledWindow. > For example, if the sample is as following > > window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); > scrolledWindow = gtk_scrolled_window_new(NULL, NULL); > > gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), > GTK_POLICY_NEVER, GTK_POLICY_NEVER); > gtk_container_add(GTK_CONTAINER(scrolledWindow), > GTK_WIDGET(webView)); > gtk_container_add(GTK_CONTAINER(window), > GTK_WIDGET(scrolledWindow)); > and then if i load and display a webpage, the scroll bars still > appear. > > However, if i change the code to something like this. > > window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); > eventbox = gtk_event_box_new(); > gtk_container_add(GTK_CONTAINER(eventbox), > GTK_WIDGET(webView)); gtk_container_add(GTK_CONTAINER(window), > GTK_WIDGET(eventbox)); > > and display a webpage, then no scroll bars appear. > > However if i use webkit2 API and write a similar sample as, > window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > webView = WKViewCreate(WKContextGetSharedProcessContext(), > 0); eventbox = gtk_event_box_new(); > gtk_container_add(GTK_CONTAINER(eventbox), > GTK_WIDGET(webView)); gtk_container_add(GTK_CONTAINER(window), > GTK_WIDGET(eventbox)); Why are you using a GtkEventBox? > and load and display the same webpage as i did previously, the > scroll bars still appear. :(. > Can you provide me some information on this and on how(if i can) > to disable the scroll bars when i use webkit2. When using the C API, WKView doesn't implement GtkScrollable, so it shouldn't be used with a GtkScrolledWindow. In this case the view will use WebKit internal scrollbars instead of the GTK ones like with any other frame. When using the GTK+ API (not available yet) WebKitWebView will implement GtkScrollable so that you will be able to use the view inside a GtkScrolledWindow and use gtk_scrolled_window_set_policy(). Regards, -- Carlos Garcia Campos http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
signature.asc
Description: PGP signature
_______________________________________________ webkit-gtk mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk
