Main Page
Widgets
Namespaces
Book
Container for widgets from other processes.
More...
Inheritance diagram for Gtk::Socket:
[legend]List of all members.
Detailed Description
Container for widgets from other processes.
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);
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.
Constructor & Destructor Documentation
virtual Gtk::Socket::~Socket |
( |
|
) |
[virtual] |
|
Member Function Documentation
void Gtk::Socket::add_id |
( |
GdkNativeWindow |
window_id |
) |
|
|
GdkNativeWindow Gtk::Socket::get_id |
( |
|
) |
const |
|
const GtkSocket* Gtk::Socket::gobj |
( |
|
) |
const [inline] |
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. |
GtkSocket* Gtk::Socket::gobj |
( |
|
) |
[inline] |
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. |
virtual void Gtk::Socket::on_plug_added |
( |
|
) |
[protected, virtual] |
|
virtual bool Gtk::Socket::on_plug_removed |
( |
|
) |
[protected, virtual] |
|
|
- Prototype:
void plug_added()
|
|
- Prototype:
bool plug_removed()
|
Friends And Related Function Documentation
Gtk::Socket* wrap |
( |
GtkSocket* |
object, |
|
|
bool |
take_copy = false |
|
) |
[related] |
|
The documentation for this class was generated from the following file:
Generated for gtkmm 2.2 by
Doxygen 1.3.4 © 1997-2001