?? gtk-themeable-stock-images.html
字號:
<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> an icon name</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> icon set of <em class="parameter"><code>stock_id</code></em>.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222511"></a><h3><a name="gtk-icon-factory-lookup-default"></a>gtk_icon_factory_lookup_default ()</h3><a class="indexterm" name="id3222525"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a>* gtk_icon_factory_lookup_default (const <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar">gchar</a> *stock_id);</pre><p>Looks for an icon in the list of default icon factories. Fordisplay to the user, you should use <a class="link" href="GtkStyle.html#gtk-style-lookup-icon-set"><code class="function">gtk_style_lookup_icon_set()</code></a> onthe <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a> for the widget that will display the icon, instead ofusing this function directly, so that themes are taken intoaccount.</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>stock_id</code></em> :</span></p></td><td> an icon name</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222626"></a><h3><a name="gtk-icon-factory-new"></a>gtk_icon_factory_new ()</h3><a class="indexterm" name="id3222639"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory">GtkIconFactory</a>* gtk_icon_factory_new (void);</pre><p>Creates a new <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>. An icon factory manages a collectionof <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a>s; a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> manages a set of variants of aparticular icon (i.e. a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> contains variants for differentsizes and widget states). Icons in an icon factory are named by astock 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>s derived from the currenttheme; those icon factories are consulted first when searching foran icon. If the theme doesn't set a particular icon, GTK+ looks forthe 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 shouldadd a default icon factory with their icons, which will allowthemes to override the icons for the application.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><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#GtkIconFactory"><span class="type">GtkIconFactory</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222772"></a><h3><a name="gtk-icon-factory-remove-default"></a>gtk_icon_factory_remove_default ()</h3><a class="indexterm" name="id3222786"></a><pre class="programlisting">void gtk_icon_factory_remove_default (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory">GtkIconFactory</a> *factory);</pre><p>Removes an icon factory from the list of default iconfactories. Not normally used; you might use it for a library thatcan be unloaded or shut down.</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> previously added 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></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3222858"></a><h3><a name="gtk-icon-set-add-source"></a>gtk_icon_set_add_source ()</h3><a class="indexterm" name="id3222871"></a><pre class="programlisting">void gtk_icon_set_add_source (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a> *icon_set, const <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource">GtkIconSource</a> *source);</pre><p>Icon sets have a list of <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a>, which they use as baseicons for rendering icons in different states and sizes. Icons arescaled, made to look insensitive, etc. in<a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-set-render-icon"><code class="function">gtk_icon_set_render_icon()</code></a>, but <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> needs base images towork with. The base images and when to use them are described bya <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a>.</p><p>This function copies <em class="parameter"><code>source</code></em>, so you can reuse the same source immediatelywithout affecting the icon set.</p><p>An example of when you'd use this function: a web browser's "Backto Previous Page" icon might point in a different direction inHebrew and in English; it might look different when insensitive;and it might change size depending on toolbar mode (small/largeicons). So a single icon set would contain all those variants ofthe icon, and you might add a separate source for each one.</p><p>You should nearly always add a "default" icon source with allfields wildcarded, which will be used as a fallback if no morespecific source matches. <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> always prefers more specificicon sources to more generic icon sources. The order in which youadd the sources to the icon set does not matter.</p><p><a class="link" href="gtk-Themeable-Stock-Images.html#gtk-icon-set-new-from-pixbuf"><code class="function">gtk_icon_set_new_from_pixbuf()</code></a> creates a new icon set with adefault icon source based on the given pixbuf.</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>icon_set</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a></td></tr><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="id3223051"></a><h3><a name="gtk-icon-set-copy"></a>gtk_icon_set_copy ()</h3><a class="indexterm" name="id3223064"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a>* gtk_icon_set_copy (<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a> *icon_set);</pre><p>Copies <em class="parameter"><code>icon_set</code></em> by value.</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>icon_set</code></em> :</span></p></td><td> a <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</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#GtkIconSet"><span class="type">GtkIconSet</span></a> identical to the first.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3223146"></a><h3><a name="gtk-icon-set-new"></a>gtk_icon_set_new ()</h3><a class="indexterm" name="id3223159"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a>* gtk_icon_set_new (void);</pre><p>Creates a new <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> represents a single iconin various sizes and widget states. It can provide a <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>for a given size and state on request, and automatically cachessome of the rendered <ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> objects.</p><p>Normally you would use <a class="link" href="GtkWidget.html#gtk-widget-render-icon"><code class="function">gtk_widget_render_icon()</code></a> instead ofusing <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> directly. The one case where you'd use<a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> is to create application-specific icon sets to place ina <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconFactory"><span class="type">GtkIconFactory</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><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#GtkIconSet"><span class="type">GtkIconSet</span></a></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3223281"></a><h3><a name="gtk-icon-set-new-from-pixbuf"></a>gtk_icon_set_new_from_pixbuf ()</h3><a class="indexterm" name="id3223295"></a><pre class="programlisting"><a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet">GtkIconSet</a>* gtk_icon_set_new_from_pixbuf (<ahref="/usr/share/gtk-doc/html/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf">GdkPixbuf</a> *pixbuf);</pre><p>Creates a new <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSet"><span class="type">GtkIconSet</span></a> with <em class="parameter"><code>pixbuf</code></em> as the default/fallbacksource image. If you don't add any additional <a class="link" href="gtk-Themeable-Stock-Images.html#GtkIconSource"><span class="type">GtkIconSource</span></a> to theicon set, all variants of the icon will be created from <em class="parameter"><code>pixbuf</code></em>,using scaling, pixelation, etc. as required to adjust the icon size
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -