2 #include <gtkmozembed.h>
4 #include "nsStringAPI.h"
5 #include "gtkmozembed_glue.cpp"
7 int main(int argc
, char *argv
[])
15 gtk_init(&argc
, &argv
);
17 static const GREVersionRange greVersion
= {
22 char xpcomPath
[PATH_MAX
];
25 GRE_GetGREPathWithProperties(&greVersion
, 1, nsnull
, 0,
26 xpcomPath
, sizeof(xpcomPath
));
28 fprintf(stderr
, "Couldn't find a compatible GRE.\n");
32 rv
= XPCOMGlueStartup(xpcomPath
);
34 fprintf(stderr
, "Couldn't start XPCOM.");
38 rv
= GTKEmbedGlueStartup();
40 fprintf(stderr
, "Couldn't find GTKMozEmbed symbols.");
44 char *lastSlash
= strrchr(xpcomPath
, '/');
48 gtk_moz_embed_set_path(xpcomPath
);
50 window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
52 container
= gtk_notebook_new();
53 mozembed
= gtk_moz_embed_new();
54 label
= gtk_label_new("Can you see this message?\n"
55 "Once you switch to mozembed page "
56 "you never see this message.");
58 gtk_signal_connect(GTK_OBJECT(mozembed
), "destroy",
59 GTK_SIGNAL_FUNC(gtk_main_quit
),
62 gtk_container_add(GTK_CONTAINER(window
), container
);
64 gtk_notebook_append_page(GTK_NOTEBOOK(container
),
66 gtk_label_new("gtk label"));
68 gtk_notebook_append_page(GTK_NOTEBOOK(container
),
70 gtk_label_new("mozembed"));
75 gtk_widget_set_usize(window
, 400, 300);
76 gtk_widget_show(mozembed
);
77 gtk_widget_show(label
);
78 gtk_widget_show_all(window
);
80 url
= (argc
> 1) ? argv
[1] : (char *)"localhost";
81 gtk_moz_embed_load_url(GTK_MOZ_EMBED(mozembed
), url
);