Re: Connecting to a signal given as a string



2008/10/26 Murray Cumming <murrayc murrayc com>:
> On Sun, 2008-10-26 at 11:28 +0100, Søren Hauberg wrote:
>> I've tried the following:
>>
>>       g_signal_connect (G_OBJECT (html_widget), "load_finished",
>>                         G_CALLBACK (on_page_loaded), this);
>>
>> in the constructor of the class that does the rendering. Then I have
>> the following function
>>
>>       static void on_page_loaded (WebView *web_view)
>>       {
>>         web_view->on_load_finished ();
>>       }
>
> Are you sure that this signal provides no parameters? I can't find any
> online documentation, so I don't know.

Ahh, that was the cause of my troubles. The function should be defined as

void on_page_loaded (WebKitWebView *web_view, WebKitWebFrame *web_frame,
  WebView *this_p)
{
  this_p->on_load_finished (web_view, web_frame);
}

which works just fine. Thanks for all the help!

Søren


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]