| Top |  |  |  |  | 
| void | gtk_plug_construct () | 
| void | gtk_plug_construct_for_display () | 
| GtkWidget * | gtk_plug_new () | 
| GtkWidget * | gtk_plug_new_for_display () | 
| Window | gtk_plug_get_id () | 
| gboolean | gtk_plug_get_embedded () | 
| GdkWindow * | gtk_plug_get_socket_window () | 
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── GtkPlug
Together with GtkSocket, GtkPlug provides the ability to embed widgets from one process into another process in a fashion that is transparent to the user. One process creates a GtkSocket widget and passes the ID of that widget’s window to the other process, which then creates a GtkPlug with that window ID. Any widgets contained in the GtkPlug then will appear inside the first application’s window.
The communication between a GtkSocket and a GtkPlug follows the XEmbed Protocol. This protocol has also been implemented in other toolkits, e.g. Qt, allowing the same level of integration when embedding a Qt widget in GTK+ or vice versa.
The GtkPlug and GtkSocket widgets are only available when GTK+
is compiled for the X11 platform and GDK_WINDOWING_X11 is defined.
They can only be used on a GdkX11Display. To use GtkPlug and
GtkSocket, you need to include the gtk/gtkx.h header.
void gtk_plug_construct (GtkPlug *plug,Window socket_id);
Finish the initialization of plug
 for a given GtkSocket identified by
socket_id
. This function will generally only be used by classes deriving from GtkPlug.
void gtk_plug_construct_for_display (GtkPlug *plug,GdkDisplay *display,Window socket_id);
Finish the initialization of plug
 for a given GtkSocket identified by
socket_id
 which is currently displayed on display
.
This function will generally only be used by classes deriving from GtkPlug.
| plug | a GtkPlug. | |
| display | the GdkDisplay associated with  | |
| socket_id | the XID of the socket’s window. | 
Since: 2.2
GtkWidget *
gtk_plug_new (Window socket_id);
Creates a new plug widget inside the GtkSocket identified
by socket_id
. If socket_id
 is 0, the plug is left “unplugged” and
can later be plugged into a GtkSocket by  gtk_socket_add_id().
GtkWidget * gtk_plug_new_for_display (GdkDisplay *display,Window socket_id);
Create a new plug widget inside the GtkSocket identified by socket_id.
| display | the GdkDisplay on which  | |
| socket_id | the XID of the socket’s window. | 
Since: 2.2
Window
gtk_plug_get_id (GtkPlug *plug);
Gets the window ID of a GtkPlug widget, which can then
be used to embed this window inside another window, for
instance with gtk_socket_add_id().
gboolean
gtk_plug_get_embedded (GtkPlug *plug);
Determines whether the plug is embedded in a socket.
Since: 2.14
“embedded” property“embedded” gboolean
TRUE if the plug is embedded in a socket.
Flags: Read
Default value: FALSE
Since: 2.12
“socket-window” property“socket-window” GdkWindow *
The window of the socket the plug is embedded in.
Flags: Read
Since: 2.14