2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
Themeable Stock Images
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
Manipulating stock icons
|
2000-11-05 16:09:41 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
2002-01-01 23:51:00 +00:00
|
|
|
|
|
|
|
|
2002-12-17 02:07:57 +00:00
|
|
|
<para>
|
2002-01-01 23:51:00 +00:00
|
|
|
Browse the available stock icons in the list of stock IDs found <link
|
|
|
|
linkend="gtk-Stock-Items">here</link>. You can also use
|
|
|
|
the <application>gtk-demo</application> application for this purpose.
|
|
|
|
</para>
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<para>
|
2001-02-03 01:09:41 +00:00
|
|
|
An icon factory manages a collection of #GtkIconSet; a #GtkIconSet manages a
|
|
|
|
set of variants of a particular icon (i.e. a #GtkIconSet contains variants for
|
|
|
|
different sizes and widget states). Icons in an icon factory are named by a
|
|
|
|
stock ID, which is a simple string identifying the icon. Each #GtkStyle has a
|
|
|
|
list of #GtkIconFactory derived from the current theme; those icon factories
|
|
|
|
are consulted first when searching for an icon. If the theme doesn't set a
|
|
|
|
particular icon, GTK+ looks for the icon in a list of default icon factories,
|
|
|
|
maintained by gtk_icon_factory_add_default() and
|
|
|
|
gtk_icon_factory_remove_default(). Applications with icons should add a default
|
|
|
|
icon factory with their icons, which will allow themes to override the icons
|
|
|
|
for the application.
|
|
|
|
</para>
|
2000-11-05 16:09:41 +00:00
|
|
|
|
2001-02-03 01:09:41 +00:00
|
|
|
<para>
|
|
|
|
To display an icon, always use gtk_style_lookup_icon_set() on the widget that
|
|
|
|
will display the icon, or the convenience function
|
|
|
|
gtk_widget_render_icon(). These functions take the theme into account when
|
|
|
|
looking up the icon to use for a given stock ID.
|
2000-11-05 16:09:41 +00:00
|
|
|
</para>
|
|
|
|
|
2008-03-07 00:08:16 +00:00
|
|
|
<refsect2 id="GtkIconFactory-BUILDER-UI"><title>GtkIconFactory as GtkBuildable</title>
|
|
|
|
<para>
|
|
|
|
GtkIconFactory supports a custom <sources> element, which
|
|
|
|
can contain multiple <source> elements.
|
|
|
|
The following attributes are allowed:
|
|
|
|
<variablelist>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>stock-id</term>
|
|
|
|
<listitem><para>The stock id of the source, a string.
|
|
|
|
This attribute is mandatory</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>filename</term>
|
|
|
|
<listitem><para>The filename of the source, a string.
|
2008-05-24 23:19:01 +00:00
|
|
|
This attribute is optional</para>
|
2008-03-07 00:08:16 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>icon-name</term>
|
|
|
|
<listitem><para>The icon name for the source, a string.
|
|
|
|
This attribute is optional.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>size</term>
|
|
|
|
<listitem><para>Size of the icon, a #GtkIconSize enum value.
|
|
|
|
This attribute is optional.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>direction</term>
|
|
|
|
<listitem><para>Direction of the source, a #GtkTextDirection enum value.
|
|
|
|
This attribute is optional.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>state</term>
|
|
|
|
<listitem><para>State of the source, a #GtkStateType enum value.
|
|
|
|
This attribute is optional.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
<example>
|
|
|
|
<title>A <structname>GtkIconFactory</structname> UI definition fragment.</title>
|
|
|
|
<programlisting><![CDATA[
|
|
|
|
<object class="GtkIconFactory" id="iconfactory1">
|
|
|
|
<sources>
|
|
|
|
<source stock-id="apple-red" filename="apple-red.png"/>
|
|
|
|
</sources>
|
|
|
|
</object>
|
|
|
|
<object class="GtkWindow" id="window1">
|
|
|
|
<child>
|
|
|
|
<object class="GtkButton" id="apple_button">
|
|
|
|
<property name="label">apple-red</property>
|
|
|
|
<property name="use-stock">True</property>
|
|
|
|
</object>
|
|
|
|
</child>
|
|
|
|
</object>
|
|
|
|
]]></programlisting>
|
|
|
|
</example>
|
|
|
|
</refsect2>
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2005-06-20 22:06:27 +00:00
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
<!-- ##### SECTION Image ##### -->
|
|
|
|
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### STRUCT GtkIconSource ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GtkIconFactory ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GtkIconSet ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### ENUM GtkIconSize ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@GTK_ICON_SIZE_INVALID:
|
|
|
|
@GTK_ICON_SIZE_MENU:
|
|
|
|
@GTK_ICON_SIZE_SMALL_TOOLBAR:
|
|
|
|
@GTK_ICON_SIZE_LARGE_TOOLBAR:
|
|
|
|
@GTK_ICON_SIZE_BUTTON:
|
2001-06-25 01:51:58 +00:00
|
|
|
@GTK_ICON_SIZE_DND:
|
2001-03-23 22:21:06 +00:00
|
|
|
@GTK_ICON_SIZE_DIALOG:
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_copy ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_free ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_add ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@stock_id:
|
|
|
|
@icon_set:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_add_default ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_lookup ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
@stock_id:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_lookup_default ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@stock_id:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
@void:
|
2000-11-05 16:09:41 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_factory_remove_default ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factory:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_set_add_source ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@source:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_set_copy ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_set_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
@void:
|
2000-11-05 16:09:41 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_set_new_from_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pixbuf:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_set_ref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_set_render_icon ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@style:
|
|
|
|
@direction:
|
|
|
|
@state:
|
|
|
|
@size:
|
|
|
|
@widget:
|
|
|
|
@detail:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2010-12-04 16:44:53 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_set_render_icon_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@context:
|
|
|
|
@size:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_set_unref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_size_lookup ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2001-03-12 18:46:53 +00:00
|
|
|
@size:
|
2000-11-05 16:09:41 +00:00
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
Documentation fixes.
Sun Oct 13 18:50:14 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenu.sgml, gtkitemfactory.c, gdkwindow.c,
gtkwindow.c, gtkpaned.sgml, gtkdialog.c, gtkbox.h, gtkbutton.sgml,
gtktreemodel.sgml,gtktable.sgml, gtktable.c:
Documentation fixes.
#85719, #90759, #95169, Owen Taylor;
#89221, Yao Zhang, Matthias Clasen;
#95592, Joost Faassen;
#92637, Vitaly Tishkov;
#94616, Ben Martin;
#94772, sbaillie@bigpond.net.au;
2002-10-13 17:17:14 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_size_lookup_for_settings ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@settings:
|
|
|
|
@size:
|
|
|
|
@width:
|
|
|
|
@height:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2000-11-05 16:09:41 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_size_register ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2001-03-12 18:46:53 +00:00
|
|
|
@name:
|
2000-11-05 16:09:41 +00:00
|
|
|
@width:
|
|
|
|
@height:
|
2001-03-12 18:46:53 +00:00
|
|
|
@Returns:
|
2000-11-05 16:09:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_size_register_alias ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@alias:
|
|
|
|
@target:
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_size_from_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@name:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_size_get_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@size:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-09-08 06:24:46 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_set_get_sizes ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@icon_set:
|
|
|
|
@sizes:
|
|
|
|
@n_sizes:
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_direction ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_direction_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_filename ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2003-07-02 22:45:30 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_icon_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_size_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_state ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_get_state_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2010-05-08 05:18:53 +00:00
|
|
|
@void:
|
2001-03-23 22:21:06 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_direction ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@direction:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_direction_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@setting:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_filename ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@filename:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_pixbuf ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@pixbuf:
|
|
|
|
|
|
|
|
|
2003-07-02 22:45:30 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_icon_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@icon_name:
|
|
|
|
|
|
|
|
|
2001-03-23 22:21:06 +00:00
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_size ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@size:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_size_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@setting:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_state ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@state:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_icon_source_set_state_wildcarded ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@source:
|
|
|
|
@setting:
|
|
|
|
|
|
|
|
|