more plug oddness ...
- From: Michael Meeks <michael ximian com>
- To: Owen Taylor <otaylor redhat com>
- Cc: Gtk Hackers <gtk-devel-list gnome org>
- Subject: more plug oddness ...
- Date: Wed, 7 Nov 2001 01:38:06 -0500 (EST)
Hi Owen,
Everything is lovely out of proc with the new socket setup
ie. your suggested:
> gtk_plug_new (0); gtk_socket_add_id (gtk_plug_get_id (plug))?
My only problem with this scheme, is working out how
plug->socket_window gets set; in the in-proc case, so that when
we hit:
void
_gtk_plug_add_to_socket (GtkPlug *plug,
GtkSocket *socket)
...
if (GTK_WIDGET_REALIZED (widget))
gdk_window_reparent (widget->window, plug->socket_window, 0, 0);
plug->socket_window holds non-NULL and we have a chance of not
just unparenting our GdkWindow.
This looks a tad daft but FALSE == 0 -> NULL:
- plug->socket_window = FALSE;
+ plug->socket_window = NULL;
I'm also having issues with the plug's gdk window not being
shown correctly; I have to have the following code to actualy see an
embedded widget at all with the suggested sequence ( in-proc ):
static void
realize_cb (GtkWidget *socket, gpointer user_data)
{
GtkWidget *plug, *w;
g_warning ("Realize");
plug = gtk_plug_new (0);
w = gtk_button_new_with_label ("Baa");
gtk_widget_show_all (w);
gtk_widget_show (plug);
gtk_container_add (GTK_CONTAINER (plug), w);
+++ GTK_PLUG (plug)->socket_window = GTK_WIDGET (socket)->window;
gtk_socket_add_id (GTK_SOCKET (socket),
gtk_plug_get_id (GTK_PLUG (plug)));
+++ gdk_window_show (GTK_WIDGET (plug)->window);
}
...
socket = gtk_socket_new ();
g_signal_connect (G_OBJECT (socket), "realize",
G_CALLBACK (realize_cb), NULL);
gtk_widget_show (GTK_WIDGET (socket));
gtk_box_pack_start (GTK_BOX (vbox), socket, TRUE, TRUE,
2);
...
I have no clue why I need to show the gdk window to see ought,
the socket_window kludge is detailed above.
Am I being dopey again, or are these genine bugs, I'd really
like to clean up bonobo_control_frame_set_remote_window. It seems that
the suggested method is not actualy exercised in gtk+/test/testsocket
which would perhaps be good.
Regards,
Michael.
--
mmeeks gnu org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]