Hi all
I've been trying to embedd mozilla. This is the test file I created.
Problem is, when I try to run it, it segfaults on the line where it creates the
new browser (browser = gtk_moz_embed_new();).
Any help would be appreciated.
Thanks in advance.
-----
This is how I compile it:
g++ \
`gtk-config --libs --cflags` `glib-config --libs --cflags` \
`pkg-config mozilla-gtkmozembed --libs --cflags` \
moztest.cpp -o moztest && ./moztest
--- this is the moztest.cpp file:
#include <gtk/gtk.h>
#include "gtkmozembed.h"
#include "mozilla-config.h"
#include <stdio.h>
int main(int argc, char * argv[])
{
GtkWidget * window;
GtkWidget * browser;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
printf("Setting up component path.\n");
fflush(stdout);
gtk_moz_embed_set_comp_path("/usr/lib/mozilla");
printf("Setting up profile.\n");
fflush(stdout);
gtk_moz_embed_set_profile_path("/safe/users/joao/.mozilla", "mozilla");
printf("Getting browser.\n");
fflush(stdout);
// browser = gtk_moz_embed_new();
browser = gtk_moz_embed_new();
printf("Checking browser.\n");
fflush(stdout);
if(!browser)
{
printf("Browser is null.\n");
fflush(stdout);
}
gtk_container_add(GTK_CONTAINER(window), browser);
gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser), "http://www.ondaware.com/");
printf("Here.\n");
fflush(stdout);
gtk_widget_show(window);
gtk_main();
return 0;
}
_______________________________________________
mozilla-embedding mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-embedding