<html> <head><title>Gtk-- Reference: Gtk::Socket</title></head> <body bgcolor="#F0F0F0" text="#000000" link="#0000FF" vlink="#000077" alink="#FF0000"> <table align=center border=0 cellspacing=10> <tr> <td><a href="class_index.html">Class Index</a></td> <td><a href="cross_index.html">Cross Index</a></td> <td><a href="name_index.html">Namespace Index</a></td> </table> <h1 align=center>Class Gtk::Socket</h1><p> <b> Container for widgets from other processes.</b><br> Contained in: <a href="Gtk.html">Gtk</a><br> Derived from: <a href="Gtk%3A%3AContainer.html">Gtk::Container</a> <br> Derived by: <i>none</i> <p> #include <gtk--/socket.h> <p> <hr noshade> <table border=0> <tr><td colspan=3><h3>public function member index:</h3></td> <tr valign=top><td align=right><tt></tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2721"><tt><font color=blue><b>Socket</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=navy>GtkSocket</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2717"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>()</tt>;</td> <tr valign=top><td align=right><tt><tt>const</tt> <tt><font color=navy>GtkSocket</font></tt>*</tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2718"><tt><font color=blue><b>gtkobj</b></font></tt></a></td><td><tt>() <tt>const</tt></tt>;</td> <tr valign=top><td align=right><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2719"><tt><font color=blue><b>isA</b></font></tt></a></td><td><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt><font color=purple>void</font></tt></tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2722"><tt><font color=blue><b>steal</b></font></tt></a></td><td><tt>(<tt><font color=purple>guint32</font></tt> <tt><font color=blue>wid</font></tt>)</tt>;</td> <tr valign=top><td align=right><tt><tt>virtual</tt> </tt> </td><td align=right><a href="Gtk%3A%3ASocket.html#2720"><tt><font color=blue><b>~Socket</b></font></tt></a></td><td><tt>()</tt>;</td> <tr><td> </td></table> <hr noshade> <h2>Description:</h2> Together with <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3APlug.html"><tt><font color=navy><b>Plug</b></font></tt></a></tt>, <tt><font color=navy><b>Gtk::Socket</b></font></tt> 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 <tt><tt><font color=blue>Gtk::Socket</font></tt></tt> widget and, passes the XID of that widget's window to the other process, which then creates a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3APlug.html"><tt><font color=navy><b>Plug</b></font></tt></a></tt> window with that XID. Any widgets contained in the <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3APlug.html"><tt><font color=navy><b>Plug</b></font></tt></a></tt> then will appear inside the first applications window. <P> The XID of the socket's window is obtained by using the GTK_WINDOW_XWINDOW() macro. Before using this macro, the socket must have been realized, and for hence, have been added to its parent. <P> Note that if you pass the XID 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 field of the <tt><font color=navy><b>Gtk::Socket</b></font></tt> structure. If this field is non-NULL, then the plug has been succesfully created inside of the socket. <P> When GTK-- 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. <P> A socket can also be used to swallow arbitrary pre-existing top-level windows using <a href="Gtk%3A%3ASocket.html#2722"><tt><font color=blue><b>steal</b></font></tt></a>, though the integration when this is done will not be as close as between a <tt><a href="Gtk.html"><tt><font color=navy><b>Gtk</b></font></tt></a>::<a href="Gtk%3A%3APlug.html"><tt><font color=navy><b>Plug</b></font></tt></a></tt> and a <tt><font color=navy><b>Gtk::Socket</b></font></tt>.<br> <p> <hr noshade> <h2>Function Member Descriptions:</h2> <a name="2717"><font size=+1><b>Gtk::Socket::gtkobj</b></font></a> - Returns the underlaying gtk+ object.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=navy>GtkSocket</font></tt>*</tt> <a href="Gtk%3A%3ASocket.html#2717"><tt><font color=blue><b>gtkobj</b></font></tt></a><tt>()</tt>;<br><br> <a name="2719"><font size=+1><b>Gtk::Socket::isA</b></font></a> - Returns true if object is this type.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt>static</tt> <tt><font color=purple>bool</font></tt></tt> <a href="Gtk%3A%3ASocket.html#2719"><tt><font color=blue><b>isA</b></font></tt></a><tt>(<a href="Gtk%3A%3AObject.html"><tt><font color=navy><b>Object</b></font></tt></a>* <tt><font color=blue>object</font></tt>)</tt>;<br><br> <a name="2722"><font size=+1><b>Gtk::Socket::steal</b></font></a> - Reparents a pre-existing toplevel window into a GtkSocket.<br> <hr size="1" width="70%" align="left" noshade="noshade"><tt><tt><font color=purple>void</font></tt></tt> <a href="Gtk%3A%3ASocket.html#2722"><tt><font color=blue><b>steal</b></font></tt></a><tt>(<tt><font color=purple>guint32</font></tt> <tt><font color=blue>wid</font></tt>)</tt>;<br><blockquote> <tt><font color=blue>wid</font></tt>: The XID of an existing toplevel window.</blockquote> <br><br> <hr noshade> </html>