?? gtk-themeable-stock-images.html
字號:
(<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource">GtkIconSource</a> *source, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> setting);</pre></div><div class="refsect1" lang="en"><a name="id3221598"></a><h2>Object Hierarchy</h2><pre class="synopsis"> <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> +----GtkIconFactory</pre></div><div class="refsect1" lang="en"><a name="id3221623"></a><h2>Description</h2><p>Browse the available stock icons in the list of stock IDs found <a class="link" href="gtk-Stock-Items.html" title="Stock Items">here</a>. You can also use the <span class="application">gtk-demo</span> application for this purpose.</p><p> An icon factory manages a collection of <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a>; a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> manages a set of variants of a particular icon (i.e. a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> 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 <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a> has a list of <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a> 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 <a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-add-default"><code class="function">gtk_icon_factory_add_default()</code></a> and <a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-remove-default"><code class="function">gtk_icon_factory_remove_default()</code></a>. Applications with icons should add a default icon factory with their icons, which will allow themes to override the icons for the application.</p><p>To display an icon, always use <a class="link" href="GtkStyle.html#gtk-style-lookup-icon-set"><code class="function">gtk_style_lookup_icon_set()</code></a> on the widget thatwill display the icon, or the convenience function<a class="link" href="GtkWidget.html#gtk-widget-render-icon"><code class="function">gtk_widget_render_icon()</code></a>. These functions take the theme into account whenlooking up the icon to use for a given stock ID.</p></div><div class="refsect1" lang="en"><a name="id3221760"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3221771"></a><h3><a name="GtkIconSource"></a>GtkIconSource</h3><a class="indexterm" name="id3221784"></a><pre class="programlisting">typedef struct _GtkIconSource GtkIconSource;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3221799"></a><h3><a name="GtkIconFactory-struct"></a>GtkIconFactory</h3><a class="indexterm" name="id3221812"></a><pre class="programlisting">typedef struct _GtkIconFactory GtkIconFactory;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3221828"></a><h3><a name="GtkIconSet"></a>GtkIconSet</h3><a class="indexterm" name="id3221839"></a><pre class="programlisting">typedef struct _GtkIconSet GtkIconSet;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3221855"></a><h3><a name="GtkIconSize"></a>enum GtkIconSize</h3><a class="indexterm" name="id3221867"></a><pre class="programlisting">typedef enum{ GTK_ICON_SIZE_INVALID, GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR, GTK_ICON_SIZE_LARGE_TOOLBAR, GTK_ICON_SIZE_BUTTON, GTK_ICON_SIZE_DND, GTK_ICON_SIZE_DIALOG} GtkIconSize;</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id3221886"></a><h3><a name="gtk-icon-source-copy"></a>gtk_icon_source_copy ()</h3><a class="indexterm" name="id3221898"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource">GtkIconSource</a>* gtk_icon_source_copy (const <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource">GtkIconSource</a> *source);</pre><p>Creates a copy of <em class="parameter"><code>source</code></em>; mostly useful for language bindings.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3221982"></a><h3><a name="gtk-icon-source-free"></a>gtk_icon_source_free ()</h3><a class="indexterm" name="id3221995"></a><pre class="programlisting">void gtk_icon_source_free (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource">GtkIconSource</a> *source);</pre><p>Frees a dynamically-allocated icon source, along with itsfilename, size, and pixbuf fields if those are not <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222065"></a><h3><a name="gtk-icon-factory-add"></a>gtk_icon_factory_add ()</h3><a class="indexterm" name="id3222078"></a><pre class="programlisting">void gtk_icon_factory_add (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory">GtkIconFactory</a> *factory, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id, <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a> *icon_set);</pre><p>Adds the given <em class="parameter"><code>icon_set</code></em> to the icon factory, under the name<em class="parameter"><code>stock_id</code></em>. <em class="parameter"><code>stock_id</code></em> should be namespaced for your application,e.g. "myapp-whatever-icon". Normally applications create a<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>, then add it to the list of default factories with<a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-factory-add-default"><code class="function">gtk_icon_factory_add_default()</code></a>. Then they pass the <em class="parameter"><code>stock_id</code></em> towidgets such as <a class="link" href="GtkImage.html" title="GtkImage"><span class="type">GtkImage</span></a> to display the icon. Themes can providean icon with the same name (such as "myapp-whatever-icon") tooverride your application's default icons. If an icon alreadyexisted in <em class="parameter"><code>factory</code></em> for <em class="parameter"><code>stock_id</code></em>, it is unreferenced and replacedwith the new <em class="parameter"><code>icon_set</code></em>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>stock_id</code></em> :</span></p></td><td> icon name</td></tr><tr><td><p><span class="term"><em class="parameter"><code>icon_set</code></em> :</span></p></td><td> icon set</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222257"></a><h3><a name="gtk-icon-factory-add-default"></a>gtk_icon_factory_add_default ()</h3><a class="indexterm" name="id3222271"></a><pre class="programlisting">void gtk_icon_factory_add_default (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory">GtkIconFactory</a> *factory);</pre><p>Adds an icon factory to the list of icon factories searched by<a class="link" href="GtkStyle.html#gtk-style-lookup-icon-set"><code class="function">gtk_style_lookup_icon_set()</code></a>. This means that, for example,<a class="link" href="GtkImage.html#gtk-image-new-from-stock"><code class="function">gtk_image_new_from_stock()</code></a> will be able to find icons in <em class="parameter"><code>factory</code></em>.There will normally be an icon factory added for each library orapplication that comes with icons. The default icon factoriescan be overridden by themes.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>factory</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222363"></a><h3><a name="gtk-icon-factory-lookup"></a>gtk_icon_factory_lookup ()</h3><a class="indexterm" name="id3222376"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a>* gtk_icon_factory_lookup (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory">GtkIconFactory</a> *factory, const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id);</pre><p>Looks up <em class="parameter"><code>stock_id</code></em> in the icon factory, returning an icon setif found, otherwise <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. For display to the user, you shoulduse <a class="link" href="GtkStyle.html#gtk-style-lookup-icon-set"><code class="function">gtk_style_lookup_icon_set()</code></a> on the <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a> for thewidget that will display the icon, instead of using thisfunction directly, so that themes are taken into account.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -