/usr/share/gtk-doc/html/pygtk/class-gtkrcstyle.html is in python-gtk2-doc 2.24.0-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.RcStyle</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="prev" href="class-gtkrange.html" title="gtk.Range"><link rel="next" href="class-gtkrecentaction.html" title="gtk.RecentAction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.RcStyle</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkrange.html">Prev</a> </td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gtkrecentaction.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.RcStyle"><a name="class-gtkrcstyle"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.RcStyle</h2><p>gtk.RcStyle — an object holding resource styles</p></div><div class="refsect1" title="Synopsis"><a name="id3861136"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.RcStyle</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#method-gtkrcstyle--copy" title="gtk.RcStyle.copy">copy</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>
<code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-add-default-file" title="gtk.rc_add_default_file">gtk.rc_add_default_file</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-set-default-files" title="gtk.rc_set_default_files">gtk.rc_set_default_files</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filenames</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-default-files" title="gtk.rc_get_default_files">gtk.rc_get_default_files</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-style-by-paths" title="gtk.rc_get_style_by_paths">gtk.rc_get_style_by_paths</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>class_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-reparse-all-for-settings" title="gtk.rc_reparse_all_for_settings">gtk.rc_reparse_all_for_settings</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>force_load</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-reset-styles" title="gtk.rc_reset_styles">gtk.rc_reset_styles</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-parse" title="gtk.rc_parse">gtk.rc_parse</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-parse-string" title="gtk.rc_parse_string">gtk.rc_parse_string</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rc_string</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-reparse-all" title="gtk.rc_reparse_all">gtk.rc_reparse_all</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-find-module-in-path" title="gtk.rc_find_module_in_path">gtk.rc_find_module_in_path</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>module_file</code></strong></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-theme-dir" title="gtk.rc_get_theme_dir">gtk.rc_get_theme_dir</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-module-dir" title="gtk.rc_get_module_dir">gtk.rc_get_module_dir</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-im-module-path" title="gtk.rc_get_im_module_path">gtk.rc_get_im_module_path</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-im-module-file" title="gtk.rc_get_im_module_file">gtk.rc_get_im_module_file</a></span>(<span class="methodparam"></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3861578"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
+-- <a class="link" href="class-gtkrcstyle.html" title="gtk.RcStyle">gtk.RcStyle</a>
</pre></div><div class="refsect1" title="Attributes"><a name="attributes-gtkrcstyle"></a><h2>Attributes</h2><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Available in PyGTK 2.16 and above.</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Some of the following attributes are arrays
of <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a> or
strings. Array objects themselves are read-only but individual elements are
read-write.</p></div><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"name"</td><td valign="top">Read-Write</td><td valign="top">Name of the style.</td></tr><tr valign="top"><td valign="top">"bg_pixmap_name"</td><td valign="top">Read</td><td valign="top">An array of names of pixmap files to be used as the background in
each widget state.</td></tr><tr valign="top"><td valign="top">"font_desc"</td><td valign="top">Read-Write</td><td valign="top">A <code class="classname">pango.FontDescription</code> used as the default
text font.</td></tr><tr valign="top"><td valign="top">"fg"</td><td valign="top">Read</td><td valign="top">An array
of <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>s
to be used for the foreground colors in each widget state.</td></tr><tr valign="top"><td valign="top">"bg"</td><td valign="top">Read</td><td valign="top">An array
of <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>s
to be used for the background colors in each widget state.</td></tr><tr valign="top"><td valign="top">"text"</td><td valign="top">Read</td><td valign="top">An array
of <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>s
to be used for the text colors in each widget state.</td></tr><tr valign="top"><td valign="top">"base"</td><td valign="top">Read</td><td valign="top">An array
of <a class="link" href="class-gdkcolor.html" title="gtk.gdk.Color"><code class="classname">gtk.gdk.Color</code></a>s
to be used for the base colors in each widget state.</td></tr><tr valign="top"><td valign="top">"xthickness"</td><td valign="top">Read-Write</td><td valign="top">The thickness of lines drawn vertically.</td></tr><tr valign="top"><td valign="top">"ythickness"</td><td valign="top">Read-Write</td><td valign="top">The thickness of lines drawn horizontally.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="gtk.RcStyle Signal Prototypes"><a name="signal-prototypes-gtkrcstyle"></a><h2>gtk.RcStyle Signal Prototypes</h2><p><PYGTKDOCLINK HREF="signal-prototypes-gobject">gobject.GObject Signal Prototypes</PYGTKDOCLINK></p></div><div class="refsect1" title="Description"><a name="id3861906"></a><h2>Description</h2><p><code class="literal">PyGTK</code> via <code class="literal">GTK+</code> provides
resource file mechanism for configuring various aspects of the operation of
a program at runtime.</p><p>An application can cause <code class="literal">GTK+</code> to parse a
specific RC file by calling the <a class="link" href="class-gtkrcstyle.html#function-gtk--rc-parse" title="gtk.rc_parse"><code class="function">gtk.rc_parse</code>()</a>
function. In addition to this, certain files will be read at the end of
<code class="literal">GTK+</code> initialization. Unless modified, the files looked
for will be <code class="filename"><SYSCONFDIR>/gtk-2.0/gtkrc</code> and
.gtkrc-2.0 in the users home directory. (<SYSCONFDIR> defaults to
<code class="filename">/usr/local/etc</code>.) The set of these default files can be
retrieved with the <a class="link" href="class-gtkrcstyle.html#function-gtk--rc-get-default-files" title="gtk.rc_get_default_files"><code class="function">gtk.rc_get_default_files</code>()</a>
function and modified with the <a class="link" href="class-gtkrcstyle.html#function-gtk--rc-add-default-file" title="gtk.rc_add_default_file"><code class="function">gtk.rc_add_default_file</code>()</a>
and <a class="link" href="class-gtkrcstyle.html#function-gtk--rc-set-default-files" title="gtk.rc_set_default_files"><code class="function">gtk.rc_set_default_files</code>()</a>
functions. Additionally, the <code class="envar">GTK_RC_FILES</code> environment
variable can be set to a list of files in order to overwrite the set of
default files at runtime.</p><p>For each RC file, in addition to the file itself,
<code class="literal">GTK+</code> will look for a locale-specific file that will be
parsed after the main file. For instance, if <code class="envar">LANG</code> is set to
<code class="literal">ja_JP.ujis</code>, when loading the default file
<code class="filename">~/.gtkrc</code> then <code class="literal">GTK+</code> looks for
<code class="filename">~/.gtkrc.ja_JP</code> and <code class="filename">~/.gtkrc.ja</code>,
and parses the first of those that exists.</p><p>A resource file defines a number of styles and key bindings and
attaches them to particular widgets. The attachment is done by the widget,
widget_class, and class declarations. As an example of such a
statement:</p><pre class="programlisting">
widget "mywindow.*.GtkEntry" style "my-entry-class"
</pre><p>attaches the style "my-entry-class" to all widgets whose widget class
matches the pattern "mywindow.*.GtkEntry". The patterns here are given in
the standard shell glob syntax. The "?" wildcard matches any character,
while "*" matches zero or more of any character. The three types of matching
are against the widget path, the class path and the class hierarchy. Both
the widget and the class paths consists of a "." separated list of all the
parents of the widget and the widget itself from outermost to innermost. The
difference is that in the widget path, the name assigned by the <a class="link" href="class-gtkwidget.html#method-gtkwidget--set-name" title="gtk.Widget.set_name"><code class="methodname">set_name</code>()</a>
method is used if present, otherwise the class name of the widget, while for
the widget path, the class name is always used. So, if you have a <a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a> named
"myentry", inside of a of a window named "mywindow", then the widget path
is: "mwindow.GtkHBox.myentry" while the class path is:
"GtkWindow.GtkHBox.GtkEntry".</p><p>Matching against class is a little different. The pattern match is
done against all class names in the widgets class hierarchy (not the layout
hierarchy) in sequence, so the pattern:</p><pre class="programlisting">
class "GtkButton" style "my-style"
</pre><p>will match not just <a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</code></a> widgets,
but also <a class="link" href="class-gtktogglebutton.html" title="gtk.ToggleButton"><code class="classname">gtk.ToggleButton</code></a>
and <a class="link" href="class-gtkcheckbutton.html" title="gtk.CheckButton"><code class="classname">gtk.CheckButton</code></a>
widgets, since those classes derive from <a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</code></a>.</p><p>An RC file is a text file which is composed of a sequence of
declarations. '#' characters delimit comments and the portion of a line
after a '#' is ignored when parsing an RC file. The possible toplevel
declarations are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">binding <em class="parameter"><code>name</code></em> { ... }</span></p></td><td>Declares a binding set.</td></tr><tr><td><p><span class="term">class <em class="parameter"><code>pattern</code></em> [ style | binding [ : priority ]] <em class="parameter"><code>name</code></em></span></p></td><td>Specifies a style or binding set for a particular branch
of the inheritance hierarchy.</td></tr><tr><td><p><span class="term">include <em class="parameter"><code>filename</code></em></span></p></td><td>Parses another file at this point. If
<em class="parameter"><code>filename</code></em> is not an absolute filename, it is searched
in the directories of the currently open RC files. <code class="literal">GTK+</code>
also tries to load a locale-specific variant of the included file.</td></tr><tr><td><p><span class="term">module_path <em class="parameter"><code>path</code></em></span></p></td><td>Sets a path (a list of directories separated by colons)
that will be searched for theme engines referenced in RC files.</td></tr><tr><td><p><span class="term">pixmap_path <em class="parameter"><code>path</code></em></span></p></td><td>Sets a path (a list of directories separated by colons)
that will be searched for pixmaps referenced in RC files.</td></tr><tr><td><p><span class="term">style <em class="parameter"><code>name</code></em> [ = <em class="parameter"><code>parent</code></em> ] { ... }</span></p></td><td>Declares a style.</td></tr><tr><td><p><span class="term">widget <em class="parameter"><code>pattern</code></em> [ style | binding [ : priority ]] <em class="parameter"><code>name</code></em></span></p></td><td>Specifies a style or binding set for a particular group
of widgets by matching on the widget pathname.</td></tr><tr><td><p><span class="term">widget_class <em class="parameter"><code>pattern</code></em> [ style | binding [ : priority ]] <em class="parameter"><code>name</code></em></span></p></td><td>Specifies a style or binding set for a particular group
of widgets by matching on the class pathname.</td></tr></tbody></table><p>A RC style is specified by a style declaration in a RC file, and
then bound to widgets with a <code class="literal">widget</code>,
<code class="literal">widget_class</code>, or <code class="literal">class</code> declaration.
All styles applying to a particular widget are composited together with
widget declarations overriding <code class="literal">widget_class</code> declarations
which, in turn, override <code class="literal">class</code> declarations. Within each
type of declaration, later declarations override earlier ones. Within a
style declaration, the possible elements are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term">bg[<em class="parameter"><code>state</code></em>] = <em class="parameter"><code>color</code></em></span></p></td><td>Sets the color used for the background of most
widgets.</td></tr><tr><td><p><span class="term">fg[<em class="parameter"><code>state</code></em>] = <em class="parameter"><code>color</code></em></span></p></td><td>Sets the color used for the foreground of most
widgets.</td></tr><tr><td><p><span class="term">base[<em class="parameter"><code>state</code></em>] = <em class="parameter"><code>color</code></em></span></p></td><td>Sets the color used for the background of widgets
displaying editable text. This color is used for the background of, among
others, <a class="link" href="class-gtktextview.html" title="gtk.TextView"><code class="classname">gtk.TextView</code></a> and
<a class="link" href="class-gtkentry.html" title="gtk.Entry"><code class="classname">gtk.Entry</code></a>.</td></tr><tr><td><p><span class="term">text[<em class="parameter"><code>state</code></em>] = <em class="parameter"><code>color</code></em></span></p></td><td>Sets the color used for foreground of widgets using
<em class="parameter"><code>base</code></em> for the background color.</td></tr><tr><td><p><span class="term">bg_pixmap[<em class="parameter"><code>state</code></em>] = <em class="parameter"><code>pixmap</code></em></span></p></td><td> Sets a background pixmap to be used in place of the
<code class="literal">bg</code> color (or for <a class="link" href="class-gtktextview.html" title="gtk.TextView"><code class="classname">gtk.TextView</code></a>, in
place of the <code class="literal">base</code> color). The special value
"<parent>" may be used to indicate that the widget should use the same
background pixmap as its parent. The special value "<none>" may be
used to indicate no background pixmap.</td></tr><tr><td><p><span class="term">font = <em class="parameter"><code>font</code></em></span></p></td><td>Sets the font for a widget. font must be a XLFD font
description, e.g.
"-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*".</td></tr><tr><td><p><span class="term">fontset = <em class="parameter"><code>font</code></em></span></p></td><td>Sets the fontset for a widget. Overrides any font
declarations. font must be a comma-separated list of XLFD font descriptions,
e.g. "-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240,
-JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120,
-GB-Fixed-Medium-R-Normal--26-180-100-100-C-240,
-Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150".</td></tr><tr><td><p><span class="term">font_name = <em class="parameter"><code>font</code></em></span></p></td><td>Sets the font for a widget. Overrides any
<code class="literal">font</code> or <code class="literal">fontset</code> declarations.
<em class="parameter"><code>font</code></em> must be a Pango font name, e.g. "Sans Italic
10".</td></tr><tr><td><p><span class="term">stock["<em class="parameter"><code>stock-id</code></em>"] = { <em class="parameter"><code>icon source specifications</code></em> }</span></p></td><td>Defines the icon for a stock item.</td></tr><tr><td><p><span class="term">engine "<em class="parameter"><code>engine</code></em>" { <em class="parameter"><code>engine-specific settings</code></em> }</span></p></td><td>Defines the engine to be used when drawing with this
style.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>class</code></em>::<em class="parameter"><code>property</code></em> = <em class="parameter"><code>value</code></em></span></p></td><td>Sets a <a class="link" href="class-gtkwidget.html#widget-style-properties">style property</a> for a widget
class.</td></tr></tbody></table><p>The colors and background pixmaps are specified as a function of
the state of the widget. The states are:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">NORMAL</code></span></p></td><td>A color used for a widget in its normal state.</td></tr><tr><td><p><span class="term"><code class="literal">ACTIVE</code></span></p></td><td>A variant of the <code class="literal">NORMAL</code> color used
when the widget is in the <code class="literal">gtk.STATE_ACTIVE</code> state, and
also for the trough of a <a class="link" href="class-gtkscrollbar.html" title="gtk.Scrollbar"><code class="classname">gtk.Scrollbar</code></a>,
tabs of a <a class="link" href="class-gtknotebook.html" title="gtk.Notebook"><code class="classname">gtk.Notebook</code></a> other
than the current tab and similar areas. Frequently, this should be a darker
variant of the <code class="literal">NORMAL</code> color.</td></tr><tr><td><p><span class="term"><code class="literal">PRELIGHT</code></span></p></td><td>A color used for widgets in the
<code class="literal">gtk.STATE_PRELIGHT</code> state. This state is the used for
<a class="link" href="class-gtkbutton.html" title="gtk.Button"><code class="classname">gtk.Button</code></a> and
<a class="link" href="class-gtkmenuitem.html" title="gtk.MenuItem"><code class="classname">gtk.MenuItem</code></a>
widgets that have the mouse cursor over them, and for their
children.</td></tr><tr><td><p><span class="term"><code class="literal">SELECTED</code></span></p></td><td>A color used to highlight data selected by the user. for
instance, the selected items in a list widget, and the selection in an
editable widget.</td></tr><tr><td><p><span class="term"><code class="literal">INSENSITIVE</code></span></p></td><td>A color used for the background of widgets that have been
set insensitive with the <a class="link" href="class-gtkwidget.html#method-gtkwidget--set-sensitive" title="gtk.Widget.set_sensitive"><code class="methodname">set_sensitive</code>()</a>
method.</td></tr></tbody></table><p>Colors can be specified as a string containing a color name (from
the X color database <code class="filename">/usr/lib/X11/rgb.txt</code>), in one of
the hexadecimal forms <code class="literal">#rrrrggggbbbb</code>,
<code class="literal">#rrrgggbbb</code>, <code class="literal">#rrggbb</code>, or
<code class="literal">#rgb</code>, where <code class="literal">r</code>, <code class="literal">g</code>
and <code class="literal">b</code> are hex digits, or they can be specified as a
triplet <code class="literal">{ r, g, b}</code>, where <code class="literal">r</code>,
<code class="literal">g</code> and <code class="literal">b</code> are either integers in the
range 0-65635 or floats in the range 0.0-1.0.</p><p>In a stock definition, icon sources are specified as a 4-tuple of
image filename, text direction, widget state, and size, in that order. Each
icon source specifies an image filename to use with a given direction,
state, and size. The * character can be used as a wildcard, and if
direction-state-size are omitted they default to *. So for example, the
following specifies different icons to use for left-to-right and
right-to-left languages:</p><pre class="programlisting">
stock["my-stock-item"] =
{
{ "itemltr.png", LTR, *, * },
{ "itemrtl.png", RTL, *, * }
}
</pre><p>This could be abbreviated as follows:</p><pre class="programlisting">
stock["my-stock-item"] =
{
{ "itemltr.png", LTR },
{ "itemrtl.png", RTL }
}
</pre><p>You can specify custom icons for specific sizes, as
follows:</p><pre class="programlisting">
stock["my-stock-item"] =
{
{ "itemmenusize.png", *, *, "gtk-menu" },
{ "itemtoolbarsize.png", *, *, "gtk-large-toolbar" }
{ "itemgeneric.png" } /* implicit *, *, * as a fallback */
}
</pre><p>The sizes that come with <code class="literal">GTK+</code> itself are
"gtk-menu", "gtk-small-toolbar", "gtk-large-toolbar", "gtk-button",
"gtk-dialog". Applications can define other sizes. It's also possible to use
custom icons for a given state, for example:</p><pre class="programlisting">
stock["my-stock-item"] =
{
{ "itemprelight.png", *, PRELIGHT },
{ "iteminsensitive.png", *, INSENSITIVE },
{ "itemgeneric.png" } /* implicit *, *, * as a fallback */
}
</pre><p>When selecting an icon source to use, <code class="literal">GTK+</code> will
consider text direction most important, state second, and size third. It
will select the best match based on those criteria. If an attribute matches
exactly (e.g. you specified <code class="literal">PRELIGHT</code> or specified the
size), <code class="literal">GTK+</code> won't modify the image; if the attribute
matches with a wildcard, <code class="literal">GTK+</code> will scale or modify the
image to match the state and size the user requested.</p><p>Key bindings allow the user to specify actions to be taken on
particular key presses. The form of a binding set declaration is:</p><pre class="programlisting">
binding name {
bind key {
signalname (param, ...)
...
}
...
}
</pre><p><em class="parameter"><code>key</code></em> is a string consisting of a series of
modifiers followed by the name of a key. The modifiers can be:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><alt></li><li class="listitem"><control></li><li class="listitem"><mod1></li><li class="listitem"><mod2></li><li class="listitem"><mod3></li><li class="listitem"><mod4></li><li class="listitem"><mod5></li><li class="listitem"><release></li><li class="listitem"><shft></li><li class="listitem"><shift></li></ul></div><p><shft> is an alias for <shift> and <alt> is an
alias for <mod1>.</p><p>The action that is bound to the key is a sequence of signal names
(strings) followed by parameters for each signal. The signals must be action
signals. Each parameter can be a float, integer, string, or unquoted string
representing an enumeration value. The types of the parameters specified
must match the types of the parameters of the signal. Binding sets are
connected to widgets in the same manner as styles, with one addition. A
priority can be specified for each pattern, and within each type of pattern,
binding sets override other binding sets first by priority, and only then by
order of specification. (Later overrides earlier). The priorities that can
be specified are (highest to lowest):</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">highest</li><li class="listitem">rc</li><li class="listitem">theme</li><li class="listitem">application</li><li class="listitem">gtk</li><li class="listitem">lowest</li></ul></div><p><code class="literal">rc</code> is the default for bindings read from an RC
file, <code class="literal">theme</code> is the default for bindings read from theme
RC files, <code class="literal">application</code> should be used for bindings an
application sets up, and <code class="literal">gtk</code> is used for bindings that
<code class="literal">GTK+</code> creates internally.</p></div><div class="refsect1" title="Methods"><a name="id3863355"></a><h2>Methods</h2><div class="refsect2" title="gtk.RcStyle.copy"><a name="method-gtkrcstyle--copy"></a><h3>gtk.RcStyle.copy</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">copy</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a new <a class="link" href="class-gtkrcstyle.html" title="gtk.RcStyle"><code class="classname">gtk.RcStyle</code></a> that is
a copy of the rcstyle</td></tr></tbody></table><p>The copy() method returns a new <a class="link" href="class-gtkrcstyle.html" title="gtk.RcStyle"><code class="classname">gtk.RcStyle</code></a> that is
a copy of the RC style. This method will correctly copy an RC style that is
a member of a class derived from <a class="link" href="class-gtkrcstyle.html" title="gtk.RcStyle"><code class="classname">gtk.RcStyle</code></a>.</p></div></div><div class="refsect1" title="Functions"><a name="id3863441"></a><h2>Functions</h2><div class="refsect2" title="gtk.rc_add_default_file"><a name="function-gtk--rc-add-default-file"></a><h3>gtk.rc_add_default_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_add_default_file</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the name of a file containing resource
data</td></tr></tbody></table><p>The <code class="function">gtk.rc_add_default_file</code>() function adds
the file specified by <em class="parameter"><code>filename</code></em> to the list of files
to be parsed for resource data.</p></div><div class="refsect2" title="gtk.rc_set_default_files"><a name="function-gtk--rc-set-default-files"></a><h3>gtk.rc_set_default_files</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_set_default_files</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filenames</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filenames</code></strong> :</span></p></td><td>a list of filenames</td></tr></tbody></table><p>The <code class="function">gtk.rc_set_default_files</code>() function
sets the list of files (specified by <em class="parameter"><code>filenames</code></em>) that
will be parsed for resource information.</p></div><div class="refsect2" title="gtk.rc_get_default_files"><a name="function-gtk--rc-get-default-files"></a><h3>gtk.rc_get_default_files</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_default_files</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the current list of resource
files</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_default_files</code>() function
returns a list of filenames (as set by the <a class="link" href="class-gtkrcstyle.html#function-gtk--rc-set-default-files" title="gtk.rc_set_default_files"><code class="function">gtk.rc_set_default_files</code>()</a>
function) that will be parsed for resource data.</p></div><div class="refsect2" title="gtk.rc_get_style_by_paths"><a name="function-gtk--rc-get-style-by-paths"></a><h3>gtk.rc_get_style_by_paths</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_style_by_paths</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>widget_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>class_path</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>settings</code></strong> :</span></p></td><td>a <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>widget_path</code></strong> :</span></p></td><td>the widget path to use when looking up the
style</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>class_path</code></strong> :</span></p></td><td>the class path to use when looking up the
style</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>a type that will be used along with parent
types of this type when matching against class styles, or
<code class="literal">gobject.TYPE_NONE</code></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gtkstyle.html" title="gtk.Style"><code class="classname">gtk.Style</code></a> created by
matching with the supplied paths, or <code class="literal">None</code> if nothing
matching was specified and the default style should be
used.</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_style_by_paths</code>() function
returns a <a class="link" href="class-gtkstyle.html" title="gtk.Style"><code class="classname">gtk.Style</code></a> created
from styles defined in a RC file by providing the raw components used in
matching. This function may be useful when creating pseudo-widgets that
should be themed like widgets but don't actually have corresponding
<code class="literal">PyGTK</code> widgets. An example of this would be items inside a
<code class="literal">GNOME</code> canvas widget.</p></div><div class="refsect2" title="gtk.rc_reparse_all_for_settings"><a name="function-gtk--rc-reparse-all-for-settings"></a><h3>gtk.rc_reparse_all_for_settings</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_reparse_all_for_settings</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>force_load</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>settings</code></strong> :</span></p></td><td>a <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>force_load</code></strong> :</span></p></td><td>if <code class="literal">True</code> reparse the RC files
even if they haven't changed</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the files were
reparsed</td></tr></tbody></table><p>The <code class="function">gtk.rc_reparse_all_for_settings</code>()
function reparses the files associated with the <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object specified by <em class="parameter"><code>settings</code></em> if any of the files have
changed and <em class="parameter"><code>force_load</code></em> is <code class="literal">False</code>
and . If <em class="parameter"><code>force_load</code></em> is <code class="literal">True</code> the
files are always reparsed.</p></div><div class="refsect2" title="gtk.rc_reset_styles"><a name="function-gtk--rc-reset-styles"></a><h3>gtk.rc_reset_styles</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_reset_styles</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>settings</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>settings</code></strong> :</span></p></td><td>a <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a <a class="link" href="class-gtkstyle.html" title="gtk.Style"><code class="classname">gtk.Style</code></a></td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">gtk.rc_reset_styles</code>() function returns
a <a class="link" href="class-gtkstyle.html" title="gtk.Style"><code class="classname">gtk.Style</code></a>. This
function computes the styles for all widgets that use the <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object specified by <em class="parameter"><code>settings</code></em>. (There is one <a class="link" href="class-gtksettings.html" title="gtk.Settings"><code class="classname">gtk.Settings</code></a>
object per <a class="link" href="class-gdkscreen.html" title="gtk.gdk.Screen"><code class="classname">gtk.gdk.Screen</code></a>, see
the <a class="link" href="class-gtksettings.html#function-gtk--settings-get-for-screen" title="gtk.settings_get_for_screen"><code class="function">gtk.settings_get_for_screen</code>()</a>
function). It is useful when some global parameter has changed that affects
the appearance of all widgets, because when a widget gets a new style, it
will both redraw and recompute any cached information about its
appearance. As an example, it is used when the default font size set by the
operating system changes. Note that this function doesn't affect widgets
that have a style set explicitly on them with the <a class="link" href="class-gtkwidget.html#method-gtkwidget--set-style" title="gtk.Widget.set_style"><code class="methodname">gtk.Widget.set_style</code>()</a>
method.</p></div><div class="refsect2" title="gtk.rc_parse"><a name="function-gtk--rc-parse"></a><h3>gtk.rc_parse</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_parse</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>filename</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>filename</code></strong> :</span></p></td><td>the name of a file to parse for resource
data</td></tr></tbody></table><p>The <code class="function">gtk.rc_parse</code>() function parses the file
specified by <em class="parameter"><code>filename</code></em> for resource data.</p></div><div class="refsect2" title="gtk.rc_parse_string"><a name="function-gtk--rc-parse-string"></a><h3>gtk.rc_parse_string</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_parse_string</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>rc_string</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>rc_string</code></strong> :</span></p></td><td>a string to parse for resource
data</td></tr></tbody></table><p>The <code class="function">gtk.rc_parse_string</code>() function parses
the string specified by <em class="parameter"><code>rc_string</code></em> for resource
data.</p></div><div class="refsect2" title="gtk.rc_reparse_all"><a name="function-gtk--rc-reparse-all"></a><h3>gtk.rc_reparse_all</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_reparse_all</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td><code class="literal">True</code> if the files were
reparsed.</td></tr></tbody></table><p>The <code class="function">gtk.rc_reparse_all</code>() function discards
all style data and reparses all the RC files for resource data if any of
them have changed.</p></div><div class="refsect2" title="gtk.rc_find_module_in_path"><a name="function-gtk--rc-find-module-in-path"></a><h3>gtk.rc_find_module_in_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_find_module_in_path</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>module_file</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>module_file</code></strong> :</span></p></td><td>the name of a theme engine</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the filename of the theme engine or
<code class="literal">None</code></td></tr></tbody></table><p>The <code class="function">gtk.rc_find_module_in_path</code>() function
searches for a theme engine named by <em class="parameter"><code>module_file</code></em>.
This function is not useful for applications and should not be used.</p></div><div class="refsect2" title="gtk.rc_get_theme_dir"><a name="function-gtk--rc-get-theme-dir"></a><h3>gtk.rc_get_theme_dir</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_theme_dir</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the name of the themes
directory</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_theme_dir</code>() function returns
the name of the directory where themes should be installed.</p></div><div class="refsect2" title="gtk.rc_get_module_dir"><a name="function-gtk--rc-get-module-dir"></a><h3>gtk.rc_get_module_dir</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_module_dir</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the theme engines directory
name</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_module_dir</code>() function
returns the name of the directory where <code class="literal">PyGTK</code> searches
for theme engines.</p></div><div class="refsect2" title="gtk.rc_get_im_module_path"><a name="function-gtk--rc-get-im-module-path"></a><h3>gtk.rc_get_im_module_path</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_im_module_path</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the IM modules path</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_im_module_path</code>() function
returns the path where <code class="literal">PyGTK</code> searches for IM
modules.</p></div><div class="refsect2" title="gtk.rc_get_im_module_file"><a name="function-gtk--rc-get-im-module-file"></a><h3>gtk.rc_get_im_module_file</h3><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">gtk.rc_get_im_module_file</span>(<span class="methodparam"></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the name of the IM modules
file</td></tr></tbody></table><p>The <code class="function">gtk.rc_get_im_module_file</code>() function
returns the name of the <code class="literal">PyGTK</code> IM modules file.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkrange.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gtkrecentaction.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.Range </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.RecentAction</td></tr></table></div></body></html>
|