<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 08/18/2014 11:35 PM, Dub wrote:<br>
</div>
<blockquote
cite="mid:CAK4iz+0HvDLTF4XgVtKY9sSy8=6Cr6Txb86UwRUBPkaKAtyGqg@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">So I have a
<div><br>
</div>
<div>
<div>struct data {</div>
<div> WebKitWebView *web_view;</div>
<div>};</div>
</div>
<div><br>
</div>
<div>And I start the webview and add it too my window</div>
<div><br>
</div>
<div>data.web_view = (WebKitWebView *) webkit_web_view_new();<br>
</div>
<div>GtkWidget *web_window = gtk_scrolled_window_new(NULL,
NULL);<br>
</div>
<div>
<div>gtk_container_add(GTK_CONTAINER(web_window),
GTK_WIDGET(notes.web_view));</div>
</div>
<div><br>
</div>
<div>And then I have a signal</div>
<div><br>
</div>
<div>g_signal_connect(blah, "blah", G_CALLBACK(function),
&data);<br>
</div>
<div><br>
</div>
<div>And a function</div>
<div><br>
</div>
<div>void function(struct data *blah) {</div>
<div> webkit_web_view_load_html(blah->web_view, html,
NULL);</div>
<div>}</div>
<div><br>
</div>
<div>And everything but the callback works, when I press the
button I get</div>
<div><br>
</div>
<div>** CRITICAL **: void
webkit_web_view_load_html(WebKitWebView*, const gchar*, const
gchar*): assertion 'WEBKIT_IS_WEB_VIEW(webView)' failed<br>
</div>
<div><br>
</div>
<div>But the passed in value is the webview, I've also tried not
using a struct and it still isn't working.</div>
<div><br>
</div>
<div>Any ideas on what could be wrong? Do I need to wait for it
too load or do something else? I see the HTML (it's only
<h1>Hello</h1> so it shouldn't take long) before I
press the button.</div>
</div>
</blockquote>
This is difficult to diagnose, since you left a lot out. A <a
href="http://www.sscce.org/">short, self contained example</a>
would help.<br>
<br>
Some guesses though:<br>
<ul>
<li>Are you sure <tt>void user_function(struct data*)</tt> is the
correct function signature for your callback? A lot of callbacks
pass the object that fired the signal as the first argument.<br>
<br>
For example, WebKitWebView's "<a
href="http://webkitgtk.org/reference/webkit2gtk/unstable/WebKitWebView.html#WebKitWebView-authenticate">authenticate</a>"
expects something like <tt>gboolean
user_function(WebKitWebView*, WebKitAuthenticationRequest*,
gpointer)</tt> (where gpointer is the data you passed to
g_signal_connect). Another example is GtkButton's "<a
href="https://developer.gnome.org/gtk3/unstable/GtkButton.html#GtkButton-clicked">click</a>"
handler, which expects a callback like void
user_function(GtkButton*, gpointer user_data).<br>
<br>
I suspect this is your problem, but it's impossible to tell
because you didn't tell us the signal you connected.</li>
<li>Another option is that <tt>data</tt> was freed before the
callback was called. I suspect you would usually get a different
error message in this case though, but it's possible.</li>
</ul>
</body>
</html>