1999-08-16 18:51:52 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GtkSocket
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
Container for widgets from other processes.
|
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
Together with #GtkPlug, #GtkSocket 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 #GtkSocket widget and, passes the
|
2002-01-09 00:02:30 +00:00
|
|
|
that widget's window ID to the other process,
|
|
|
|
which then creates a #GtkPlug with that window ID.
|
1999-08-16 18:51:52 +00:00
|
|
|
Any widgets contained in the #GtkPlug then will appear
|
|
|
|
inside the first applications window.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2002-01-09 00:02:30 +00:00
|
|
|
The socket's window ID is obtained by using
|
Doc typo fix. (#68172)
* gtk/gtksocket.c (gtk_socket_get_id): Doc typo fix. (#68172)
* gtk/gtktreemodel.c (gtk_tree_path_is_descendant): Fix docs.
* gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Document.
* gtk/gtkwindow.c (gtk_window_remove_accel_group): Fix docs.
* gtk/gtkrc.c (gtk_rc_get_style_by_paths),
gtk/gtkwidget.c (gtk_widget_get_toplevel,
gtk_widget_push_composite_child), gtk/gtkdialog.c
(gtk_dialog_new_with_buttons, gtk_dialog_run): Keep gtk-doc
from messing up the indentation of inline examples.
* gtk/gtkmain.c, gtk/gtkrc.c: Consistently call g_getenv()
instead of getenv().
* gtk/gtktreemodel.c, gtk/gtkaccelgroup.c, gtk/gtkclipboard.c,
gtk/gtkdnd.c, gtk/gtkiconfactory.c, gtk/gtkrc.c,
gtk/gtkstyle.c, gtk/gtkselection.c: Doc fixes.
* gtk/gtkaccelmap.c (gtk_accel_map_add_filter,
gtk_accel_map_foreach_unfiltered, gtk_accel_map_load_scanner):
Document.
* gtk/tmpl/gtksocket.sgml: Mention gtk_socket_get_id()
instead of GTK_WINDOW_XWINDOW(). (#68172)
* gtk/gtk-sections.txt: Move functions which are documented
as "private" or "internal" into Private subsections.
* gtk/tmpl/gtkdnd.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtktooltips.sgml,
gtk/tmpl/gtkwidget.sgml, gtk/tmpl/gtkclipboard.sgml,
gtk/tmpl/gtkstyle.sgml, gtk/tmpl/gtkselection.sgml,
gtk/tmpl/gtkfeatures.sgml: Minor markup fixes.
* gtk/tmpl/gtksignal.sgml: Add link to GLib signal docs.
* gtk/tmpl/gtkpreview.sgml, gtk/tmpl/gtktext.sgml,
gtk/tmpl/gtktree.sgml: Remove "deprecated" from short desc.
* gtk/tmpl/gtkrc.sgml: Correct names of default RC files.
2002-01-08 00:04:57 +00:00
|
|
|
gtk_socket_get_id(). Before using this function,
|
1999-08-16 18:51:52 +00:00
|
|
|
the socket must have been realized, and for hence,
|
|
|
|
have been added to its parent.
|
|
|
|
|
|
|
|
<example>
|
2002-01-09 00:02:30 +00:00
|
|
|
<title>Obtaining the window ID of a socket.</title>
|
1999-08-16 18:51:52 +00:00
|
|
|
<programlisting>
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
GtkWidget *socket = gtk_socket_new (<!>);
|
1999-08-16 18:51:52 +00:00
|
|
|
gtk_widget_show (socket);
|
|
|
|
gtk_container_add (GTK_CONTAINER (parent), socket);
|
|
|
|
|
|
|
|
/* The following call is only necessary if one of
|
|
|
|
* the ancestors of the socket is not yet visible.
|
|
|
|
*/
|
|
|
|
gtk_widget_realize (socket);
|
2002-01-09 00:02:30 +00:00
|
|
|
g_print ("The ID of the sockets window is %#x\n",
|
Doc typo fix. (#68172)
* gtk/gtksocket.c (gtk_socket_get_id): Doc typo fix. (#68172)
* gtk/gtktreemodel.c (gtk_tree_path_is_descendant): Fix docs.
* gtk/gtktreemodel.c (gtk_tree_model_rows_reordered): Document.
* gtk/gtkwindow.c (gtk_window_remove_accel_group): Fix docs.
* gtk/gtkrc.c (gtk_rc_get_style_by_paths),
gtk/gtkwidget.c (gtk_widget_get_toplevel,
gtk_widget_push_composite_child), gtk/gtkdialog.c
(gtk_dialog_new_with_buttons, gtk_dialog_run): Keep gtk-doc
from messing up the indentation of inline examples.
* gtk/gtkmain.c, gtk/gtkrc.c: Consistently call g_getenv()
instead of getenv().
* gtk/gtktreemodel.c, gtk/gtkaccelgroup.c, gtk/gtkclipboard.c,
gtk/gtkdnd.c, gtk/gtkiconfactory.c, gtk/gtkrc.c,
gtk/gtkstyle.c, gtk/gtkselection.c: Doc fixes.
* gtk/gtkaccelmap.c (gtk_accel_map_add_filter,
gtk_accel_map_foreach_unfiltered, gtk_accel_map_load_scanner):
Document.
* gtk/tmpl/gtksocket.sgml: Mention gtk_socket_get_id()
instead of GTK_WINDOW_XWINDOW(). (#68172)
* gtk/gtk-sections.txt: Move functions which are documented
as "private" or "internal" into Private subsections.
* gtk/tmpl/gtkdnd.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtktooltips.sgml,
gtk/tmpl/gtkwidget.sgml, gtk/tmpl/gtkclipboard.sgml,
gtk/tmpl/gtkstyle.sgml, gtk/tmpl/gtkselection.sgml,
gtk/tmpl/gtkfeatures.sgml: Minor markup fixes.
* gtk/tmpl/gtksignal.sgml: Add link to GLib signal docs.
* gtk/tmpl/gtkpreview.sgml, gtk/tmpl/gtktext.sgml,
gtk/tmpl/gtktree.sgml: Remove "deprecated" from short desc.
* gtk/tmpl/gtkrc.sgml: Correct names of default RC files.
2002-01-08 00:04:57 +00:00
|
|
|
gtk_socket_get_id (socket));
|
1999-08-16 18:51:52 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2002-01-09 00:02:30 +00:00
|
|
|
Note that if you pass the window ID of the socket to another
|
1999-08-16 18:51:52 +00:00
|
|
|
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
|
|
|
|
<StructField>plug_window</StructField> field of the
|
Markup fixes.
* gtk/gtkdialog.c, gtk/gtkrc.c, gtk/gtkwidget.c: Markup fixes.
* gdk-pixbuf-io.c: Markup fixes.
* gdk-pixbuf/tmpl/scaling.sgml, gdk/tmpl/fonts.sgml,
gdk/tmpl/general.sgml, gdk/tmpl/rgb.sgml, gdk/tmpl/visuals.sgml,
gdk/tmpl/windows.sgml, gtk/gtk-docs.sgml, gtk/tmpl/gtkaccellabel.sgml,
gtk/tmpl/gtkcombo.sgml, gtk/tmpl/gtkdialog.sgml,
gtk/tmpl/gtkdrawingarea.sgml, gtk/tmpl/gtkeditable.sgml,
gtk/tmpl/gtkfilesel.sgml, gtk/tmpl/gtkfontseldlg.sgml,
gtk/tmpl/gtkimage.sgml, gtk/tmpl/gtkmain.sgml, gtk/tmpl/gtkmenu.sgml,
gtk/tmpl/gtkmessagedialog.sgml, gtk/tmpl/gtkobject.sgml,
gtk/tmpl/gtkpaned.sgml, gtk/tmpl/gtkradiobutton.sgml,
gtk/tmpl/gtkrc.sgml, gtk/tmpl/gtkscale.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtksocket.sgml, gtk/tmpl/gtkspinbutton.sgml,
gtk/tmpl/gtktogglebutton.sgml, gtk/tmpl/gtksignal.sgml,
gtk/tmpl/gtktooltips.sgml, gtk/tmpl/gtkwindow.sgml,
gdk/tmpl/regions.sgml, gtk/tmpl/gtkfontsel.sgml,
gtk/tmpl/gtkpixmap.sgml, gtk/tmpl/gtkprogress.sgml,
gtk/tmpl/gtkselection.sgml, gtk/tmpl/gtktable.sgml,
gtk/tmpl/gtktipsquery.sgml: Markup fixes (mainly examples).
2001-12-13 19:51:24 +00:00
|
|
|
#GtkSocket structure. If this field is non-%NULL,
|
2001-12-12 22:29:53 +00:00
|
|
|
then the plug has been successfully created inside
|
1999-08-16 18:51:52 +00:00
|
|
|
of the socket.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
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.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A socket can also be used to swallow arbitrary
|
|
|
|
pre-existing top-level windows using gtk_socket_steal(),
|
|
|
|
though the integration when this is done will not be as close
|
|
|
|
as between a #GtkPlug and a #GtkSocket.</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>#GtkPlug</term>
|
|
|
|
<listitem><para>the widget that plugs into a #GtkSocket.</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GtkSocket ##### -->
|
|
|
|
<para>
|
2002-01-09 00:02:30 +00:00
|
|
|
The #GtkSocket structure contains the <structfield>plug_window</structfield>
|
|
|
|
field. (This field should be considered read-only. It should
|
1999-08-16 18:51:52 +00:00
|
|
|
never be set by an application.)
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_socket_new ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
2001-07-05 02:54:11 +00:00
|
|
|
@Returns:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_socket_steal ##### -->
|
|
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@socket: a #GtkSocket.
|
2001-07-05 02:54:11 +00:00
|
|
|
@wid:
|
1999-08-16 18:51:52 +00:00
|
|
|
|
|
|
|
|
2001-09-08 06:24:46 +00:00
|
|
|
<!-- ##### FUNCTION gtk_socket_add_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@socket:
|
2001-12-23 22:55:17 +00:00
|
|
|
@window_id:
|
|
|
|
<!-- # Unused Parameters # -->
|
2001-09-08 06:24:46 +00:00
|
|
|
@id:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_socket_get_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@socket:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-07-05 02:54:11 +00:00
|
|
|
<!-- ##### SIGNAL GtkSocket::plug-added ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@socket: the object which received the signal.
|
|
|
|
|
|
|
|
<!-- ##### SIGNAL GtkSocket::plug-removed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@socket: the object which received the signal.
|
|
|
|
@Returns:
|
|
|
|
|