Gtk.Plug

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Bin Gtk.Bin Gtk.Window Gtk.Window Gtk.Bin->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Plug Gtk.Plug Gtk.Widget->Gtk.Container Gtk.Window->Gtk.Plug

Subclasses:

None

Methods

Inherited:

Gtk.Window (119), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (socket_id)

class

new_for_display (display, socket_id)

construct (socket_id)

construct_for_display (display, socket_id)

get_embedded ()

get_id ()

get_socket_window ()

Virtual Methods

Inherited:

Gtk.Window (5), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_embedded ()

Properties

Inherited:

Gtk.Window (33), Gtk.Container (3), Gtk.Widget (39)

Name

Type

Flags

Short Description

embedded

bool

r

Whether the plug is embedded

socket-window

Gdk.Window

r

The window of the socket the plug is embedded in

Style Properties

Inherited:

Gtk.Window (2), Gtk.Widget (17)

Signals

Inherited:

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

embedded

Gets emitted when the plug becomes embedded in a socket.

Fields

Inherited:

Gtk.Window (5), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

window

Gtk.Window

r

Class Details

class Gtk.Plug(*args, **kwargs)
Bases:

Gtk.Window

Abstract:

No

Structure:

Gtk.PlugClass

Together with Gtk.Socket, Gtk.Plug 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 Gtk.Socket widget and passes the ID of that widget’s window to the other process, which then creates a Gtk.Plug with that window ID. Any widgets contained in the Gtk.Plug then will appear inside the first application’s window.

The communication between a Gtk.Socket and a Gtk.Plug 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 Gtk.Plug and Gtk.Socket 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 Gtk.Plug and Gtk.Socket, you need to include the gtk/gtkx.h header.

classmethod new(socket_id)[source]
Parameters:

socket_id (int) – the window ID of the socket, or 0.

Returns:

the new Gtk.Plug widget.

Return type:

Gtk.Widget

Creates a new plug widget inside the Gtk.Socket identified by socket_id. If socket_id is 0, the plug is left “unplugged” and can later be plugged into a Gtk.Socket by Gtk.Socket.add_id().

classmethod new_for_display(display, socket_id)[source]
Parameters:
  • display (Gdk.Display) – the Gdk.Display on which socket_id is displayed

  • socket_id (int) – the XID of the socket’s window.

Returns:

the new Gtk.Plug widget.

Return type:

Gtk.Widget

Create a new plug widget inside the Gtk.Socket identified by socket_id.

New in version 2.2.

construct(socket_id)[source]
Parameters:

socket_id (int) – the XID of the socket’s window.

Finish the initialization of self for a given Gtk.Socket identified by socket_id. This function will generally only be used by classes deriving from Gtk.Plug.

construct_for_display(display, socket_id)[source]
Parameters:

Finish the initialization of self for a given Gtk.Socket identified by socket_id which is currently displayed on display. This function will generally only be used by classes deriving from Gtk.Plug.

New in version 2.2.

get_embedded()[source]
Returns:

True if the plug is embedded in a socket

Return type:

bool

Determines whether the plug is embedded in a socket.

New in version 2.14.

get_id()[source]
Returns:

the window ID for the plug

Return type:

int

Gets the window ID of a Gtk.Plug widget, which can then be used to embed this window inside another window, for instance with Gtk.Socket.add_id().

get_socket_window()[source]
Returns:

the window of the socket, or None

Return type:

Gdk.Window or None

Retrieves the socket the plug is embedded in.

New in version 2.14.

do_embedded() virtual

Signal Details

Gtk.Plug.signals.embedded(plug)
Signal Name:

embedded

Flags:

RUN_LAST

Parameters:

plug (Gtk.Plug) – The object which received the signal

Gets emitted when the plug becomes embedded in a socket.

Property Details

Gtk.Plug.props.embedded
Name:

embedded

Type:

bool

Default Value:

False

Flags:

READABLE

True if the plug is embedded in a socket.

New in version 2.12.

Gtk.Plug.props.socket_window
Name:

socket-window

Type:

Gdk.Window

Default Value:

None

Flags:

READABLE

The window of the socket the plug is embedded in.

New in version 2.14.