![]() | ![]() | ![]() | LibBonoboUI API Reference Manual | ![]() |
---|
BonoboSocket — Container for widgets from other processes.
struct BonoboSocket; typedef BonoboSocketClass;GtkWidget * bonobo_socket_new (void);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkSocket +----BonoboSocket
BonoboSocket implements
This is an internal support routine of the X code in Bonobo.
Together with
The XID of the socket's window is obtained by using
the
Example 1. Obtaining the XID of a socket
include <gdk/gdkx.h> GtkWidget *socket = bonobo_socket_new(); gtk_widget_show (socket); gtk_container_add (GTK_CONTAINER (parent), socket); /* The following call is only necessary if one of * the ancestors of the socket is not yet visible. */ gtk_widget_realize (socket); g_print ("The XID of the sockets window is %x \n", GDK_WINDOW_XWINDOW (socket->window));
Note that if you pass the XID of the socket to another
process that will create a plug in the socket, you
must make sure that the socket widget is not destroyed
until that plug is created. Violating this rule will
cause unpredictable consequences, the most likely
consequence being that the plug will appear as a
separate toplevel window. You can check if the plug
has been created by examining the
plug_window field of the
When GTK+ is notified that the embedded window has been destroyed, then it will destroy the socket as well. You should always, therefore, be prepared for your sockets to be destroyed at any time when the main event loop is running.
A socket can also be used to swallow arbitrary
pre-existing top-level windows using
struct BonoboSocket;
The
the window embedded inside this |
typedef struct { GtkSocketClass parent_class; gpointer dummy[4]; } BonoboSocketClass;
the widget that plugs into a |
<< BonoboPlug | bonobo-wrapper >> |