Mozilla embedding in gtk application


We are embedding mozilla in gtk application. Compiled
that application
using makefiles given in mozilla
folder. It doesn't work.

Also when we are trying it from gtk application using
kdeveloper or
anjuta IDE,  It crashes. sample code and errors are
attached. Is this problem of some libraries we are
using or
compilation flags used while compiling? If we are
missing some
libraries please let me know.

We work with this before.  And for fix this problem we
compiled mozilla with default-toolkit option to gtk2. 
In that case we were working with gtk 1.2 in  our
system and gcc 2.96.  Now our system was change to gtk
2 and gcc 3.2.  We proved many things and nothing.  We
will really preaciated your help.

If anyone knows please help us.

Here is the code that we are using for embedding

#include >stdio.h<
#include >gtk/gtk.h<
#include >gtkmozembed.h<
#include >nsEmbedAPI.h<

int main(int argc, char *argv[])
        GtkWidget *window;
        GtkWidget *vbox;
        GtkWidget *mozembed;

        gtk_init(&argc, &argv);

        gtk_moz_embed_set_profile_path(".", "mozembed");

        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        if (window == NULL)
                printf("\twindow is null\n");
                printf("\twindow is not null\n");

        gtk_widget_set_usize(window, 600, 700);

        vbox = gtk_vbox_new(FALSE, 0);
        if (vbox == NULL)
                printf("\tvbox is null\n");
                printf("\tvbox is not null\n");

        mozembed = gtk_moz_embed_new();
        if (mozembed == NULL)
                printf("\tmozembed is null\n");
                printf("\tmozembed is not null\n");


        printf("\tadding it to vbox\n");
        gtk_box_pack_start(GTK_BOX(vbox), mozembed, TRUE,
TRUE, 0);

        gtk_container_add(GTK_CONTAINER(window), vbox);




When we add given flags  ====  -lgtkembedmoz
-lgtksuperwin -lmozjs
Output is ---------

window is not null
vbox is not null

(mozilla3:9488): GLib-GObject-WARNING **: specified
instance size for
type `GtkMozEmbed' is smaller than the parent type's
`GtkBin' instance

(mozilla3:9488): Gtk-CRITICAL **: file gtktypeutils.c:
line 97
(gtk_type_new): assertion `GTK_TYPE_IS_OBJECT (type)'

(mozilla3:9488): Gtk-WARNING **: invalid cast from
(NULL) pointer to
`(unknown)'     mozembed is null

(mozilla3:9488): GLib-GObject-WARNING **: specified
instance size for
type `GtkMozEmbed' is smaller than the parent type's
`GtkBin' instance

** (mozilla3:9488): CRITICAL **: file
gtkmozembed2.cpp: line 722 (void
gtk_moz_embed_load_url (GtkMozEmbed *, const char *)):
`embed != NULL' failed.
        adding it to vbox

(mozilla3:9488): Gtk-CRITICAL **: file gtkbox.c: line
(gtk_box_pack_start): assertion `GTK_IS_WIDGET
(child)' failed

(mozilla3:9488): Gtk-CRITICAL **: file gtkwidget.c:
line 1630
(gtk_widget_show): assertion `GTK_IS_WIDGET (widget)'

When we add given flags ======  -lgtk -lgdk -lgmodule
-lgtksuperwin -lmozjs -lxpcom -lplds4 -lplc4 -lnspr4
-lpthread -ldl
-lc  -lXext -lm -lXi

        It gives segmentation fault for any gtk functions
gtk_box_pack_start(), gtk_container_add();

What are we doing wrong?

Thanks & Regards.

Yahoo! Messenger - Nueva versión GRATIS
Super Webcam, voz, caritas animadas, y más...

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