繁体   English   中英

什么是WebKitLoadEvent,如何使用“负载变化”信号回调来获取它?

[英]What is a WebKitLoadEvent and how can I get it in order to use a “load-change” signal Callback

我已经阅读了有关web_view中的加载操作更改时可能发出的负载更改信号的信息。( https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-load-changed )而且我需要使用此功能,但我不了解如何获取WebKitLoadEvent load_event来精确使用此功能。 我没有看到任何其他函数返回WebKitLoadEvent。 如何使用此功能?

static void web_view_load_changed (WebKitWebView   *web_view,WebKitLoadEvent  load_event, gpointer data)
{
  struct widget *w = (struct widget *)data;
  const gchar *redirected_uri;
  const gchar *uri;
  GTimer *timer = g_timer_new ();

    switch (load_event) {
    case WEBKIT_LOAD_STARTED:
        break;
    case WEBKIT_LOAD_REDIRECTED:
        break;
    case WEBKIT_LOAD_COMMITTED:
        break;
    case WEBKIT_LOAD_FINISHED:                            
        break;
    }
}

如您所说,此信号是从web_view发出的蜂鸣声。 因此,为了使用此功能,您只需要在创建web_view的位置将此功能与web_view连接。

看起来应该像这样:web_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_signal_connect(web_view,“ load-change”,G_CALLBAK(web_view_load_changed),(gpointer)数据);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM