Skip to main content

GtkSocketExt

Trait GtkSocketExt 

Source
pub trait GtkSocketExt:
    IsA<Socket>
    + Sealed
    + 'static {
    // Provided methods
    fn add_id(&self, window: Window) { ... }
    fn id(&self) -> Window { ... }
    fn plug_window(&self) -> Option<Window> { ... }
    fn connect_plug_added<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
    fn connect_plug_removed<F: Fn(&Self) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Available on gdk_backend=x11 only.
Expand description

Trait containing all Socket methods.

§Implementors

Socket

Provided Methods§

Source

fn add_id(&self, window: Window)

Adds an XEMBED client, such as a Plug, to the Socket. The client may be in the same process or in a different process.

To embed a Plug in a Socket, you can either create the Plug with gtk_plug_new (0), call PlugExt::id() to get the window ID of the plug, and then pass that to the add_id(), or you can call id() to get the window ID for the socket, and call Plug::new() passing in that ID.

The Socket must have already be added into a toplevel window before you can make this call.

§window

the Window of a client participating in the XEMBED protocol.

Source

fn id(&self) -> Window

Gets the window ID of a Socket widget, which can then be used to create a client embedded inside the socket, for instance with Plug::new().

The Socket must have already be added into a toplevel window before you can make this call.

§Returns

the window ID for the socket

Source

fn plug_window(&self) -> Option<Window>

Retrieves the window of the plug. Use this to check if the plug has been created inside of the socket.

§Returns

the window of the plug if available, or None

Source

fn connect_plug_added<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

This signal is emitted when a client is successfully added to the socket.

Source

fn connect_plug_removed<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

This signal is emitted when a client is removed from the socket. The default action is to destroy the Socket widget, so if you want to reuse it you must add a signal handler that returns true.

§Returns

true to stop other handlers from being invoked.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§