GtkWidget *child_widget = GTK_BIN(widget)->child; gtk_signal_connect_while_alive(GTK_OBJECT(child_widget), "focus_out_event", GTK_SIGNAL_FUNC(handle_child_focus_out), embed, GTK_OBJECT(child_widget)); gtk_signal_connect_while_alive(GTK_OBJECT(child_widget), "focus_in_event", GTK_SIGNAL_FUNC(handle_child_focus_in), embed, GTK_OBJECT(child_widget));   GtkMozArea *mozarea = GTK_MOZAREA(child_widget); gtk_signal_connect_while_alive(GTK_OBJECT(mozarea), "toplevel_focus_in", GTK_SIGNAL_FUNC(handle_toplevel_focus_in), embed, GTK_OBJECT(mozarea));  gtk_signal_connect_while_alive(GTK_OBJECT(mozarea), "toplevel_focus_out", GTK_SIGNAL_FUNC(handle_toplevel_focus_out), embed, GTK_OBJECT(mozarea));
gtk_moz_embed_realize(GtkWidget *widget){  GtkMozEmbed    *embed;  EmbedPrivate   *embedPrivate;  GdkWindowAttr   attributes;  gint            attributes_mask;    g_return_if_fail(widget != NULL);  g_return_if_fail(GTK_IS_MOZ_EMBED(widget));  embed = GTK_MOZ_EMBED(widget);  embedPrivate = (EmbedPrivate *)embed->data;  GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);  attributes.window_type = GDK_WINDOW_CHILD;  attributes.x = widget->allocation.x;  attributes.y = widget->allocation.y;  attributes.width = widget->allocation.width;  attributes.height = widget->allocation.height;  attributes.wclass = GDK_INPUT_OUTPUT;  attributes.visual = gtk_widget_get_visual (widget);  attributes.colormap = gtk_widget_get_colormap (widget);  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;  widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),				   &attributes, attributes_mask);  gdk_window_set_user_data (widget->window, embed);  widget->style = gtk_style_attach (widget->style, widget->window);  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);  // initialize the widget now that we have a window  nsresult rv;  rv = embedPrivate->Init(embed);  g_return_if_fail(NS_SUCCEEDED(rv));  rv = embedPrivate->Realize();  g_return_if_fail(NS_SUCCEEDED(rv));  if (embedPrivate->mURI.Length())    embedPrivate->LoadCurrentURI();}