Its because the page loads in the same thread as the rest of the application isnt it? So by the time webkit_web_view_load_uri returns, the page has finished loading and hence webkit_web_view_get_progress returns 0 and stays at 0 forever.

Presumably the solution is to spin a thread to handle the while loop and update the progress bar?


On 05/09/11 18:48, Andrew Wood wrote:
How can I check the progress of a page loading, so I can update a progress bar? Ive tried this:

webkit_web_view_load_uri (WEBKIT_WEB_VIEW (gtkwebview), url.c_str()); //this line on its own works

while (webkit_web_view_get_progress(WEBKIT_WEB_VIEW (gtkwebview)) < 1)
{
          //page loading so update progress bar
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar),webkit_web_view_get_progress(WEBKIT_WEB_VIEW (gtkwebview)));
 }

but it just jams in an infinite loop. How is the threading handled within WebKit? Does the loading take place in a separate thread?

Thanks
Andrew


_______________________________________________
webkit-gtk mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk

_______________________________________________
webkit-gtk mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk

Reply via email to