📄 gtk-resource-files.html
字号:
<code class="literal">PRELIGHT</code> or specified the size), GTK+ won't modify the image;if the attribute matches with a wildcard, GTK+ will scale or modify the image tomatch the state and size the user requested.</p></div><hr><div class="refsect2" lang="en"><a name="id3236255"></a><h3>Key bindings</h3><p>Key bindings allow the user to specify actions to be taken on particular key presses. The form of a bindingset declaration is:</p><div class="informalexample"><pre class="programlisting">binding <em class="replaceable"><code>name</code></em> { bind <em class="replaceable"><code>key</code></em> { <em class="replaceable"><code>signalname</code></em> (<em class="replaceable"><code>param</code></em>, ...) ... } ...}</pre></div><p><em class="replaceable"><code>key</code></em> is a string consisting of a series of modifiers followed by the name of a key. Themodifiers can be:</p><table class="simplelist" border="0" summary="Simple list"><tr><td><code class="literal"><alt></code></td></tr><tr><td><code class="literal"><ctl></code></td></tr><tr><td><code class="literal"><control></code></td></tr><tr><td><code class="literal"><meta></code></td></tr><tr><td><code class="literal"><hyper></code></td></tr><tr><td><code class="literal"><super></code></td></tr><tr><td><code class="literal"><mod1></code></td></tr><tr><td><code class="literal"><mod2></code></td></tr><tr><td><code class="literal"><mod3></code></td></tr><tr><td><code class="literal"><mod4></code></td></tr><tr><td><code class="literal"><mod5></code></td></tr><tr><td><code class="literal"><release></code></td></tr><tr><td><code class="literal"><shft></code></td></tr><tr><td><code class="literal"><shift></code></td></tr></table><p><code class="literal"><shft></code> is an alias for <code class="literal"><shift></code>,<code class="literal"><ctl></code> is an alias for <code class="literal"><control></code>, and <code class="literal"><alt></code> is an alias for<code class="literal"><mod1></code>.</p><p>The action that is bound to the key is a sequenceof signal names (strings) followed by parameters for each signal. The signals must be action signals.(See <ahref="/usr/share/gtk-doc/html/gobject/gobject-Signals.html#g-signal-new"><code class="function">g_signal_new()</code></a>). Each parameter can bea float, integer, string, or unquoted stringrepresenting an enumeration value. The types ofthe parameters specified must match the types of the parameters of the signal.</p><p>Binding sets are connected to widgets in the same manner as styles, with one difference: Binding sets override other binding sets first by pattern type, then by priority and then by order of specification.The priorities that can be specified and their default values are the same as for styles.</p></div></div><div class="refsect1" lang="en"><a name="id3233272"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3233282"></a><h3><a name="GtkRcStyle-struct"></a>GtkRcStyle</h3><a class="indexterm" name="id3233295"></a><pre class="programlisting">typedef struct { gchar *name; gchar *bg_pixmap_name[5]; PangoFontDescription *font_desc; GtkRcFlags color_flags[5]; GdkColor fg[5]; GdkColor bg[5]; GdkColor text[5]; GdkColor base[5]; gint xthickness; gint ythickness;} GtkRcStyle;</pre><p>The <a class="link" href="gtk-Resource-Files.html#GtkRcStyle"><span class="type">GtkRcStyle</span></a> structure is used to represent a setof information about the appearance of a widget.This can later be composited together with other<a class="link" href="gtk-Resource-Files.html#GtkRcStyle"><span class="type">GtkRcStyle</span></a> structures to form a <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id3233340"></a><h3><a name="GtkRcFlags"></a>enum GtkRcFlags</h3><a class="indexterm" name="id3233353"></a><pre class="programlisting">typedef enum{ GTK_RC_FG = 1 << 0, GTK_RC_BG = 1 << 1, GTK_RC_TEXT = 1 << 2, GTK_RC_BASE = 1 << 3} GtkRcFlags;</pre><p>The <a class="link" href="gtk-Resource-Files.html#GtkRcFlags"><span class="type">GtkRcFlags</span></a> enumeration is used as a bitmaskto specify which fields of a <a class="link" href="gtk-Resource-Files.html#GtkRcStyle"><span class="type">GtkRcStyle</span></a> have beenset for each state.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GTK-RC-FG:CAPS"></a><code class="literal">GTK_RC_FG</code></span></p></td><td>If present, the foreground color has been set for this state.</td></tr><tr><td><p><span class="term"><a name="GTK-RC-BG:CAPS"></a><code class="literal">GTK_RC_BG</code></span></p></td><td>If present, the background color has been set for this state.</td></tr><tr><td><p><span class="term"><a name="GTK-RC-TEXT:CAPS"></a><code class="literal">GTK_RC_TEXT</code></span></p></td><td>If present, the text color has been set for this state.</td></tr><tr><td><p><span class="term"><a name="GTK-RC-BASE:CAPS"></a><code class="literal">GTK_RC_BASE</code></span></p></td><td>If present, the base color has been set for this state.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3236812"></a><h3><a name="GtkRcTokenType"></a>enum GtkRcTokenType</h3><a class="indexterm" name="id3236825"></a><pre class="programlisting">typedef enum { GTK_RC_TOKEN_INVALID = G_TOKEN_LAST, GTK_RC_TOKEN_INCLUDE, GTK_RC_TOKEN_NORMAL, GTK_RC_TOKEN_ACTIVE, GTK_RC_TOKEN_PRELIGHT, GTK_RC_TOKEN_SELECTED, GTK_RC_TOKEN_INSENSITIVE, GTK_RC_TOKEN_FG, GTK_RC_TOKEN_BG, GTK_RC_TOKEN_TEXT, GTK_RC_TOKEN_BASE, GTK_RC_TOKEN_XTHICKNESS, GTK_RC_TOKEN_YTHICKNESS, GTK_RC_TOKEN_FONT, GTK_RC_TOKEN_FONTSET, GTK_RC_TOKEN_FONT_NAME, GTK_RC_TOKEN_BG_PIXMAP, GTK_RC_TOKEN_PIXMAP_PATH, GTK_RC_TOKEN_STYLE, GTK_RC_TOKEN_BINDING, GTK_RC_TOKEN_BIND, GTK_RC_TOKEN_WIDGET, GTK_RC_TOKEN_WIDGET_CLASS, GTK_RC_TOKEN_CLASS, GTK_RC_TOKEN_LOWEST, GTK_RC_TOKEN_GTK, GTK_RC_TOKEN_APPLICATION, GTK_RC_TOKEN_THEME, GTK_RC_TOKEN_RC, GTK_RC_TOKEN_HIGHEST, GTK_RC_TOKEN_ENGINE, GTK_RC_TOKEN_MODULE_PATH, GTK_RC_TOKEN_IM_MODULE_PATH, GTK_RC_TOKEN_IM_MODULE_FILE, GTK_RC_TOKEN_STOCK, GTK_RC_TOKEN_LTR, GTK_RC_TOKEN_RTL, GTK_RC_TOKEN_COLOR, GTK_RC_TOKEN_UNBIND, GTK_RC_TOKEN_LAST} GtkRcTokenType;</pre><p>The <a class="link" href="gtk-Resource-Files.html#GtkRcTokenType"><span class="type">GtkRcTokenType</span></a> enumeration represents the tokensin the RC file. It is exposed so that theme enginescan reuse these tokens when parsing the theme-enginespecific portions of a RC file.</p></div><hr><div class="refsect2" lang="en"><a name="id3236868"></a><h3><a name="gtk-rc-scanner-new"></a>gtk_rc_scanner_new ()</h3><a class="indexterm" name="id3236881"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Lexical-Scanner.html#GScanner">GScanner</a>* gtk_rc_scanner_new (void);</pre><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></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3236917"></a><h3><a name="gtk-rc-get-style"></a>gtk_rc_get_style ()</h3><a class="indexterm" name="id3236930"></a><pre class="programlisting"><a class="link" href="GtkStyle.html" title="Styles">GtkStyle</a>* gtk_rc_get_style (<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre><p>Finds all matching RC styles for a given widget,composites them together, and then creates a <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a> representing the composite appearance.(GTK+ actually keeps a cache of previously created styles, so a new style may not becreated.)</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>widget</code></em> :</span></p></td><td> a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> the resulting style. No refcount is added to the returned style, so if you want to save this style around, you should add a reference yourself.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3237011"></a><h3><a name="gtk-rc-get-style-by-paths"></a>gtk_rc_get_style_by_paths ()</h3><a class="indexterm" name="id3237025"></a><pre class="programlisting"><a class="link" href="GtkStyle.html" title="Styles">GtkStyle</a>* gtk_rc_get_style_by_paths (<a class="link" href="GtkSettings.html" title="Settings">GtkSettings</a> *settings, const char *widget_path, const char *class_path, <ahref="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#GType">GType</a> type);</pre><p>Creates up a <a class="link" href="GtkStyle.html" title="Styles"><span class="type">GtkStyle</span></a> from styles defined in a RC file by providingthe raw components used in matching. This function may be usefulwhen creating pseudo-widgets that should be themed like widgets butdon't actually have corresponding GTK+ widgets. An example of thiswould be items inside a GNOME canvas widget.</p><p>The action of <a class="link" href="gtk-Resource-Files.html#gtk-rc-get-style"><code class="function">gtk_rc_get_style()</code></a> is similar to:</p><div class="informalexample"><pre class="programlisting"> gtk_widget_path (widget, NULL, &path, NULL); gtk_widget_class_path (widget, NULL, &class_path, NULL); gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget), path, class_path, G_OBJECT_TYPE (widget));</pre></div><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -