|
Gtk::Socket Class ReferenceContainer for widgets from other processes.
More...
|
Public Methods | |
virtual | ~Socket () |
GtkSocket* | gobj () |
const GtkSocket* | gobj () const |
Socket () | |
void | add_id (GdkNativeWindow window_id) |
Adds an XEMBED client, such as a Gtk::Plug, to the Gtk::Socket. | |
GdkNativeWindow | get_id () const |
Gets the window ID of a Gtk::Socket widget, which can then be used to create a client embedded inside the socket, for instance with Gtk::Plug::new(). | |
Glib::SignalProxy0<void> | signal_plug_added () |
Glib::SignalProxy0<bool> | signal_plug_removed () |
Protected Methods | |
virtual void | on_plug_added () |
virtual bool | on_plug_removed () |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Socket* | wrap (GtkSocket* object, bool take_copy=false) |
Together with Gtk::Plug, Gtk::Socket 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 that widget's window ID 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 applications window.
The socket's window ID is obtained by using get_id(). Before using this function, the socket must have been realized, and for hence, have been added to its parent.
Gtk::Socket socket; parent.add(socket); // The following call is only necessary if one of the ancestors of the // socket is not yet visible socket.realize(); cout << "The ID of the sockets window is: " << socket.get_id() << endl;
Note that if you pass the window ID 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 member of the GtkSocket structure returned by gobj(). If this field is non-NULL, then the plug has been successfully created inside of the socket.
When gtkmm 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.
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 gtkmm or vice versa.
|
|
|
|
|
Adds an XEMBED client, such as a Gtk::Plug, to the Gtk::Socket. The client may be in the same process or in a different process.
To embed a Gtk::Plug in a Gtk::Socket, you can either create the Gtk::Plug with The Gtk::Socket must have already be added into a toplevel window before you can make this call.
|
|
Gets the window ID of a Gtk::Socket widget, which can then be used to create a client embedded inside the socket, for instance with Gtk::Plug::new(). The Gtk::Socket must have already be added into a toplevel window before you can make this call.
|
|
Reimplemented from Gtk::Container. |
|
Reimplemented from Gtk::Container. |
|
|
|
|
|
|
|
|
|
|