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 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.Label</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><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="previous" href="class-gtkitemfactory.html" title="gtk.ItemFactory"><link rel="next" href="class-gtklayout.html" title="gtk.Layout"></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.Label</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkitemfactory.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtklayout.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtklabel"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.Label</h2><p>gtk.Label — a widget that displays a limited amount of read-only
text</p></div><div class="refsect1" lang="en"><a name="id3452714"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.Label</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkmisc.html" title="gtk.Misc">gtk.Misc</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtklabel.html#constructor-gtklabel" title="Constructor">gtk.Label</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span><span class="initializer">=None</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-text" title="gtk.Label.set_text">set_text</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-text" title="gtk.Label.get_text">get_text</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-attributes" title="gtk.Label.set_attributes">set_attributes</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>attrs</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-attributes" title="gtk.Label.get_attributes">get_attributes</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-label" title="gtk.Label.set_label">set_label</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-label" title="gtk.Label.get_label">get_label</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-markup" title="gtk.Label.set_markup">set_markup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-use-markup" title="gtk.Label.set_use_markup">set_use_markup</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-use-markup" title="gtk.Label.get_use_markup">get_use_markup</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-use-underline" title="gtk.Label.set_use_underline">set_use_underline</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-use-underline" title="gtk.Label.get_use_underline">get_use_underline</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-markup-with-mnemonic" title="gtk.Label.set_markup_with_mnemonic">set_markup_with_mnemonic</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-mnemonic-keyval" title="gtk.Label.get_mnemonic_keyval">get_mnemonic_keyval</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget">set_mnemonic_widget</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-mnemonic-widget" title="gtk.Label.get_mnemonic_widget">get_mnemonic_widget</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-text-with-mnemonic" title="gtk.Label.set_text_with_mnemonic">set_text_with_mnemonic</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-justify" title="gtk.Label.set_justify">set_justify</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>jtype</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-justify" title="gtk.Label.get_justify">get_justify</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-pattern" title="gtk.Label.set_pattern">set_pattern</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>pattern</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-line-wrap" title="gtk.Label.set_line_wrap">set_line_wrap</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>wrap</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-line-wrap" title="gtk.Label.get_line_wrap">get_line_wrap</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-selectable" title="gtk.Label.set_selectable">set_selectable</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-selectable" title="gtk.Label.get_selectable">get_selectable</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--select-region" title="gtk.Label.select_region">select_region</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>start_offset</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>end_offset</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-selection-bounds" title="gtk.Label.get_selection_bounds">get_selection_bounds</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-layout" title="gtk.Label.get_layout">get_layout</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-layout-offsets" title="gtk.Label.get_layout_offsets">get_layout_offsets</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-ellipsize" title="gtk.Label.set_ellipsize">set_ellipsize</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>mode</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-ellipsize" title="gtk.Label.get_ellipsize">get_ellipsize</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-width-chars" title="gtk.Label.set_width_chars">set_width_chars</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-width-chars" title="gtk.Label.get_width_chars">get_width_chars</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-single-line-mode" title="gtk.Label.set_single_line_mode">set_single_line_mode</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>single_line_mode</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-single-line-mode" title="gtk.Label.get_single_line_mode">get_single_line_mode</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-single-line-mode" title="gtk.Label.get_single_line_mode">get_max_width_chars</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-single-line-mode" title="gtk.Label.set_single_line_mode">set_max_width_chars</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--get-single-line-mode" title="gtk.Label.get_single_line_mode">get_angle</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtklabel.html#method-gtklabel--set-single-line-mode" title="gtk.Label.set_single_line_mode">set_angle</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>angle</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3453345"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkmisc.html" title="gtk.Misc">gtk.Misc</a>
+-- <a href="class-gtklabel.html" title="gtk.Label">gtk.Label</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3453381"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"angle"</td><td valign="top">Read-Write</td><td valign="top">The angle that the baseline of the label makes with the
horizontal, in degrees, measured counterclockwise. An angle of 90 reads from
from bottom to top, an angle of 270, from top to bottom. Ignored if the label
is selectable, wrapped, or ellipsized. Allowed values: [0,360]
Default value: 0. Available in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"attributes"</td><td valign="top">Read-Write</td><td valign="top">A list of Pango style attributes to apply to the text
of the label.</td></tr><tr valign="top"><td valign="top">"cursor-position"</td><td valign="top">Read</td><td valign="top">The current position of the insertion cursor in
chars. Allowed values: >= 0. Default value: 0</td></tr><tr valign="top"><td valign="top">"ellipsize"</td><td valign="top">Read-Write</td><td valign="top">The preferred place to ellipsize the string, if the
label does not have enough room to display the entire string, specified as
one of the <a href="pango-constants.html#pango-ellipsize-mode-constants">Pango Ellipsize Mode Constants</a>. Note that setting
this property to a value other than <tt class="literal">pango.ELLIPSIZE_NONE</tt>
has the side-effect that the label requests only enough space to display the
ellipsis "...". In particular, this means that ellipsizing labels don't work
well in notebook tabs, unless the tab's "tab-expand" property is set to
<tt class="literal">TRUE</tt>. Other means to set a label's width are with the
<a href="class-gtkwidget.html#method-gtkwidget--set-size-request" title="gtk.Widget.set_size_request"><tt class="methodname">gtk.Widget.set_size_request</tt>()</a>
and <a href="class-gtklabel.html#method-gtklabel--set-width-chars" title="gtk.Label.set_width_chars"><tt class="methodname">set_width_chars</tt>()</a>
methods. Default value: <tt class="literal">pango.ELLIPSIZE_NONE</tt>. Available
in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"justify"</td><td valign="top">Read-Write</td><td valign="top">The alignment of the lines in the text of the label
relative to each other. The possible values are:
<tt class="literal">gtk.JUSTIFY_LEFT</tt>, <tt class="literal">gtk.JUSTIFY_RIGHT</tt>,
<tt class="literal">gtk.JUSTIFY_CENTER</tt>, <tt class="literal">gtk.JUSTIFY_FILL</tt>.
This does NOT affect the alignment of the label within its
allocation. Default value: <tt class="literal">gtk.JUSTIFY_LEFT</tt></td></tr><tr valign="top"><td valign="top">"label"</td><td valign="top">Read-Write</td><td valign="top">The text of the label. Default value:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"max-width-chars"</td><td valign="top">Read-Write</td><td valign="top">The desired maximum width of the label, in characters.
If this property is set to -1, the width will be calculated automatically,
otherwise the label will request space for no more than the requested number
of characters. If the "width-chars" property is set to a positive value, then
the "max-width-chars" property is ignored. Allowed values: >= -1.
Default value: -1. Available in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"mnemonic-keyval"</td><td valign="top">Read</td><td valign="top">The mnemonic accelerator key for this label. Default
value: 16777215</td></tr><tr valign="top"><td valign="top">"mnemonic-widget"</td><td valign="top">Read-Write</td><td valign="top">The widget to be activated when the label's mnemonic
key is pressed.</td></tr><tr valign="top"><td valign="top">"pattern"</td><td valign="top">Write</td><td valign="top">A string with _ characters in positions used to
identify to characters in the text to underline. Default value:
<tt class="literal">None</tt></td></tr><tr valign="top"><td valign="top">"selectable"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the label text can be
selected with the mouse. Default value: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"selection-bound"</td><td valign="top">Read</td><td valign="top">The position of the opposite end of the selection from
the cursor in chars. Allowed values: >= 0. Default value: 0.</td></tr><tr valign="top"><td valign="top">"single-line-mode"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt> the label is in single line
mode. In single line mode, the height of the label does not depend on the
actual text, it is always set to ascent + descent of the font. This can be
an advantage in situations where resizing the label because of text changes
would be distracting, e.g. in a statusbar. Default value:
<tt class="literal">FALSE</tt>. Available in GTK+ 2.6 and above.</td></tr><tr valign="top"><td valign="top">"use-markup"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, the text of the label
includes XML markup. Default value: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"use-underline"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, an underscore in the text
indicates the next character should be used for the mnemonic accelerator
key. Default value: <tt class="literal">FALSE</tt></td></tr><tr valign="top"><td valign="top">"width-chars"</td><td valign="top">Read-Write</td><td valign="top">The desired width of the label, in characters. If this
property is set to -1, the width will be calculated automatically, otherwise
the label will request either 3 characters or the property value, whichever
is greater. Allowed values: >= -1. Default value: -1. Available in GTK+
2.6 and above.</td></tr><tr valign="top"><td valign="top">"wrap"</td><td valign="top">Read-Write</td><td valign="top">If <tt class="literal">TRUE</tt>, wrap lines if the text
becomes too wide. Default value: <tt class="literal">FALSE</tt></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3453805"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtklabel.html#signal-gtklabel--copy-clipboard" title='The "copy-clipboard" gtk.Label Signal'>copy-clipboard</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtklabel.html#signal-gtklabel--move-cursor" title='The "move-cursor" gtk.Label Signal'>move-cursor</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>step</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>count</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>extend_selection</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr><tr><td><span class="term">"<a href="class-gtklabel.html#signal-gtklabel--populate-popup" title='The "populate-popup" gtk.Label Signal'>populate-popup</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>menu</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3453950"></a><h2>Description</h2><p>The <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> is a widget
class that displays a limited amount of read-only text. Labels are used by
several widgets (e.g. <a href="class-gtkbutton.html" title="gtk.Button"><tt class="classname">gtk.Button</tt></a>, and its
subclasses, <a href="class-gtkmenuitem.html" title="gtk.MenuItem"><tt class="classname">gtk.MenuItem</tt></a>,
etc.) to provide text display as well as by applications to display
messages, etc, to the user. Most of the functionality of a <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> is directed
at modifying the style and layout of the text within the widget allocation.
A <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> is
a "windowless" object which means that it cannot receive events directly. A
<a href="class-gtkeventbox.html" title="gtk.EventBox"><tt class="classname">gtk.EventBox</tt></a>
can be used to provide event handling capabilities to a <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> widget if
needed.</p><div class="refsect2" lang="en"><a name="id3454011"></a><h3>Mnemonics</h3><p>Label text may be specified with embedded underscore characters
that are used to indicate that the following character should be underlined
and used as the mnemonic accelerator (if it's the first underlined
character). The <a href="class-gtklabel.html#method-gtklabel--set-text-with-mnemonic" title="gtk.Label.set_text_with_mnemonic"><tt class="methodname">set_text_with_mnemonic</tt>()</a>
method is used to parse the label text for a mnemonic characters. Mnemonics
automatically activate any activatable widget the label is inside, such as a
<a href="class-gtkbutton.html" title="gtk.Button"><tt class="classname">gtk.Button</tt></a>; if
the label is not inside an activatable widget, you have to tell the label
about the target using the <a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget"><tt class="methodname">set_mnemonic_widget</tt>()</a>
method. Here's a simple example where the label is inside a button:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
# Pressing Alt+H will activate this button
button = gtk.Button()
label = gtk.Label("_Hello")
label.set_use_underline(True)
button.add(label)
</pre></td></tr></table><p>As a convenience you can create a button with a mnemonic label
as follows:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
# Pressing Alt+H will activate this button
button = gtk.Button(label="_Hello", use_underline=True)
</pre></td></tr></table><p>To create a mnemonic for a widget alongside the label, such as a
<a href="class-gtkentry.html" title="gtk.Entry"><tt class="classname">gtk.Entry</tt></a>, you
have to point the label at the entry with the <a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget"><tt class="methodname">set_mnemonic_widget</tt>()</a>
method:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
# Pressing Alt+H will focus the entry
entry = gtk.Entry()
label = gtk.Label("_Hello")
label.set_use_underline(True)
label.set_mnemonic_widget(entry)
</pre></td></tr></table></div><div class="refsect2" lang="en"><a name="id3454092"></a><h3>Markup (styled text)</h3><p>To make it easy to format text in a label (changing colors, fonts,
etc.), the label text can be provided in the <a href="pango-markup-language.html" title="The Pango Markup Language">Pango markup format</a> which is a simple
XML markup format. The <a href="class-gtklabel.html#method-gtklabel--set-markup" title="gtk.Label.set_markup"><tt class="methodname">gtk.Label.set_markup</tt>()</a>
method sets the label using text in valid markup format (e.g. '<', '>'
and '&' characters must be replaced by &lt;, &gt; and &amp;
respectively. For example:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
label = gtk.Label()
label.set_markup("<small>Small text</small>");
</pre></td></tr></table><p>The markup passed to the <a href="class-gtklabel.html#method-gtklabel--set-markup" title="gtk.Label.set_markup"><tt class="methodname">set_markup</tt>()</a>
method must be valid. For example, the literal <>& characters must
be escaped as &lt;, &gt;, and &amp;. If you pass text obtained
from the user, file, or a network to the <a href="class-gtklabel.html#method-gtklabel--set-markup" title="gtk.Label.set_markup"><tt class="methodname">set_markup</tt>()</a>
method, you'll want to escape it with the Python Library
<tt class="function">xml.sax.saxutils.escape</tt>() function.</p><p>Markup strings are just a convenient way to set the <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
on a label. Using the <a href="class-gtklabel.html#method-gtklabel--set-attributes" title="gtk.Label.set_attributes"><tt class="methodname">set_attributes</tt>()</a>
method may be a simpler way to set attributes in some cases. Be careful
though; <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
tends to cause internationalization problems, unless you're applying
attributes to the entire string because specifying the start_index and
end_index for a <a href="class-pangoattribute.html" title="pango.Attribute"><tt class="classname">pango.Attribute</tt></a>
requires knowledge of the exact string being displayed, so translations will
cause problems.</p></div><div class="refsect2" lang="en"><a name="id3454185"></a><h3>Selectable labels</h3><p>Labels can be made selectable with the <a href="class-gtklabel.html#method-gtklabel--set-selectable" title="gtk.Label.set_selectable"><tt class="methodname">set_selectable</tt>()</a>
method. Selectable labels allow the user to copy the label contents to the
clipboard. Only labels that contain useful-to-copy information such as error
messages should be made selectable.</p></div><div class="refsect2" lang="en"><a name="id3454205"></a><h3>Text layout</h3><p>A label can contain any number of paragraphs, but will have
performance problems if it contains more than a small number. Paragraphs are
separated by newlines or other paragraph separators understood by
Pango.</p><p>Labels can automatically wrap text if you call the <a href="class-gtklabel.html#method-gtklabel--set-line-wrap" title="gtk.Label.set_line_wrap"><tt class="methodname">set_line_wrap</tt>()</a>
method.</p><p>The <a href="class-gtklabel.html#method-gtklabel--set-justify" title="gtk.Label.set_justify"><tt class="methodname">set_justify</tt>()</a>
method sets how the lines in a label align with one another. If you want to
set how the label as a whole aligns in its available space, see the <a href="class-gtkmisc.html#method-gtkmisc--set-alignment" title="gtk.Misc.set_alignment"><tt class="methodname">gtk.Misc.set_alignment</tt>()</a>
method.</p></div></div><div class="refsect1" lang="en"><a name="constructor-gtklabel"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.Label</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span><span class="initializer">=None</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>The text of the label or <tt class="literal">None</tt>
for a blank label</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the new <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a>
widget</td></tr></tbody></table><p>Creates a new <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> with the
text specified by <i class="parameter"><tt>str</tt></i> inside it. You can pass
<tt class="literal">None</tt> to get a blank label.</p></div><div class="refsect1" lang="en"><a name="id3454334"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtklabel--set-text"></a><h3>gtk.Label.set_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>The new text for the
label.</td></tr></tbody></table><p>The <tt class="methodname">set_text</tt>() method sets the text
within the <a href="class-gtklabel.html" title="gtk.Label"><tt class="classname">gtk.Label</tt></a> widget. It
replaces any text that was there before and will clear any previously set
mnemonic accelerators.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-text"></a><h3>gtk.Label.get_text</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_text</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the text in the label
widget.</td></tr></tbody></table><p>The <tt class="methodname">get_text</tt>() method fetches the text
from a label widget, as displayed on the screen. This does not include any
Pango markup or embedded underscore characters indicating mnemonics. (See
<a href="class-gtklabel.html#method-gtklabel--get-label" title="gtk.Label.get_label"><tt class="methodname">get_label</tt>()</a>).</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-attributes"></a><h3>gtk.Label.set_attributes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_attributes</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>attrs</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>attrs</tt></b>:</span></td><td>a <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a></td></tr></tbody></table><p>The <tt class="methodname">set_attributes</tt>() method applies a
<a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
list of attributes to the label text. The attributes set with this function
will be ignored if either the "use-underline" or "use-markup" attributes is
<tt class="literal">TRUE</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-attributes"></a><h3>gtk.Label.get_attributes</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_attributes</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the attribute list, or <tt class="literal">None</tt>
if no attributes were set.</td></tr></tbody></table><p>The <tt class="methodname">get_attributes</tt>() method returns the
attribute list that was set on the label using <a href="class-gtklabel.html#method-gtklabel--set-attributes" title="gtk.Label.set_attributes"><tt class="methodname">set_attributes</tt>()</a>,
if any. This function does not reflect attributes that come from the labels
markup (see <a href="class-gtklabel.html#method-gtklabel--set-markup" title="gtk.Label.set_markup"><tt class="methodname">set_markup</tt>()</a>).</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-label"></a><h3>gtk.Label.set_label</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_label</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>the new text (including mnemonics or markup) to
set for the label</td></tr></tbody></table><p>The <tt class="methodname">set_label</tt>() method sets the text of
the label. The label is parsed for embedded underscores and Pango markup
depending on the values of the "use-underline" and "use-markup"
properties.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-label"></a><h3>gtk.Label.get_label</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_label</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the text of the label
widget.</td></tr></tbody></table><p>The <tt class="methodname">get_label</tt>() method returns the text
from a label widget including any Pango markup and embedded underscores
indicating mnemonics. (See <a href="class-gtklabel.html#method-gtklabel--get-text" title="gtk.Label.get_text"><tt class="methodname">get_text</tt>()</a>
that just returns the text).</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-markup"></a><h3>gtk.Label.set_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_markup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>a markup string</td></tr></tbody></table><p>The <tt class="methodname">set_markup</tt>() method parses
<i class="parameter"><tt>str</tt></i>, which is marked up with the Pango text markup
language, and sets the label's text and attribute list.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-use-markup"></a><h3>gtk.Label.set_use_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_markup</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>setting</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the label's text
should be parsed for markup.</td></tr></tbody></table><p>The <tt class="methodname">set_use_markup</tt>() method sets the
"use-markup" property to the value of <i class="parameter"><tt>setting</tt></i>. If
<tt class="literal">TRUE</tt> the text of the label should be parsed as
markup.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-use-markup"></a><h3>gtk.Label.get_use_markup</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_markup</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the label's text
will be parsed for markup.</td></tr></tbody></table><p>The <tt class="methodname">get_user_markup</tt>() method returns
the value of the "use-markup" property. If <tt class="literal">TRUE</tt> the
label's text is parsed as markup. See <a href="class-gtklabel.html#method-gtklabel--set-use-markup" title="gtk.Label.set_use_markup"><tt class="methodname">set_use_markup</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-use-underline"></a><h3>gtk.Label.set_use_underline</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_use_underline</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>setting</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> underscores in the
text indicate mnemonics</td></tr></tbody></table><p>The <tt class="methodname">set_use_underline</tt>() method sets the
"use-underline" property to the value of <i class="parameter"><tt>setting</tt></i>. If
<i class="parameter"><tt>setting</tt></i> is <tt class="literal">TRUE</tt>, an underscore in
the text indicates the next character should be used for the mnemonic
accelerator key.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-use-underline"></a><h3>gtk.Label.get_use_underline</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_use_underline</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if an embedded
underscore in the label indicates the mnemonic
accelerator.</td></tr></tbody></table><p>The <tt class="methodname">get_use_underline</tt>() method returns
the value of the "use-underline" property. If <tt class="literal">TRUE</tt> an
embedded underscore in the label indicates the next character is a mnemonic.
See <a href="class-gtklabel.html#method-gtklabel--set-use-underline" title="gtk.Label.set_use_underline"><tt class="methodname">set_use_underline</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-markup-with-mnemonic"></a><h3>gtk.Label.set_markup_with_mnemonic</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_markup_with_mnemonic</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>a markup string including embedded
underscores</td></tr></tbody></table><p>The <tt class="methodname">set_markup_with_mnemonic</tt>() method
parses <i class="parameter"><tt>str</tt></i> as markup, setting the label's text and
attribute list based on the parse results. If characters in
<i class="parameter"><tt>str</tt></i> are preceded by an underscore, they are
underlined indicating that they represent a mnemonic accelerator. The
mnemonic key can be used to activate another widget, chosen automatically,
or explicitly using the <a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget"><tt class="methodname">set_mnemonic_widget</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-mnemonic-keyval"></a><h3>gtk.Label.get_mnemonic_keyval</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_mnemonic_keyval</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a keyval, or the void symbol
keyval</td></tr></tbody></table><p>The <tt class="methodname">get_mnemonic_keyval</tt>() method
returns the value of the "mnemonic-keyval" property that contains the keyval
used for the mnemonic accelerator if one has been set on the label. If there
is no mnemonic set up it returns the void symbol keyval.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-mnemonic-widget"></a><h3>gtk.Label.set_mnemonic_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_mnemonic_widget</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>widget</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>widget</tt></b>:</span></td><td>the widget to be activated when the mnemonic is
pressed</td></tr></tbody></table><p>The <tt class="methodname">set_mnemonic_widget</tt>() method sets
the "mnemonic-widget" property using the value of
<i class="parameter"><tt>widget</tt></i>. This method associates the label mnemonic
with a widget that will be activated when the mnemonic accelerator is
pressed. When the label is inside a widget (like a <a href="class-gtkbutton.html" title="gtk.Button"><tt class="classname">gtk.Button</tt></a> or a
<a href="class-gtknotebook.html" title="gtk.Notebook"><tt class="classname">gtk.Notebook</tt></a>
tab) it is automatically associated with the correct widget, but sometimes
(i.e. when the target is a <a href="class-gtkentry.html" title="gtk.Entry"><tt class="classname">gtk.Entry</tt></a> next to the
label) you need to set it explicitly using this function. The target widget
will be activated by emitting "mnemonic_activate" on it.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-mnemonic-widget"></a><h3>gtk.Label.get_mnemonic_widget</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_mnemonic_widget</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the target of the label's mnemonic, or
<tt class="literal">None</tt> if none has been set and the default algorithm will
be used.</td></tr></tbody></table><p>The <tt class="methodname">get_mnemonic_widget</tt>() method
retrieves the value of the "mnemonic-widget" property which is the target of
the mnemonic accelerator of this label. See <a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget"><tt class="methodname">set_mnemonic_widget</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-text-with-mnemonic"></a><h3>gtk.Label.set_text_with_mnemonic</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_text_with_mnemonic</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>str</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>str</tt></b>:</span></td><td>the label text with embedded underscore
characters indicating the mnemonic characters</td></tr></tbody></table><p>The <tt class="methodname">set_text_with_mnemonic</tt>() method
sets the label's text from the string <i class="parameter"><tt>str</tt></i>. If
characters in <i class="parameter"><tt>str</tt></i> are preceded by an underscore, they
are underlined indicating that they represent a mnemonic accelerator. The
mnemonic key can be used to activate another widget, chosen automatically,
or explicitly using the <a href="class-gtklabel.html#method-gtklabel--set-mnemonic-widget" title="gtk.Label.set_mnemonic_widget"><tt class="methodname">set_mnemonic_widget</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-justify"></a><h3>gtk.Label.set_justify</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_justify</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>jtype</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>jtype</tt></b>:</span></td><td>justification type</td></tr></tbody></table><p>The <tt class="methodname">set_justify</tt>() method sets the
alignment of the lines in the text of the label relative to each other using
the value of <i class="parameter"><tt>jtype</tt></i>. The possible values of
<i class="parameter"><tt>jtype</tt></i> are: <tt class="literal">gtk.JUSTIFY_LEFT</tt>,
<tt class="literal">gtk.JUSTIFY_RIGHT</tt>, <tt class="literal">gtk.JUSTIFY_CENTER</tt>
and <tt class="literal">gtk.JUSTIFY_FILL</tt>. <tt class="literal">gtk.JUSTIFY_LEFT</tt>
is the default value when the widget is first created. If you want to set
the alignment of the label as a whole, use the <a href="class-gtkmisc.html#method-gtkmisc--set-alignment" title="gtk.Misc.set_alignment"><tt class="methodname">gtk.Misc.set_alignment</tt>()</a>
method instead. The <a href="class-gtklabel.html#method-gtklabel--set-justify" title="gtk.Label.set_justify"><tt class="methodname">set_justify</tt>()</a>
has no effect on labels containing only a single line.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-justify"></a><h3>gtk.Label.get_justify</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_justify</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the label justification</td></tr></tbody></table><p>The <tt class="methodname">get_justify</tt>() method returns the
justification of the label; one of: <tt class="literal">gtk.JUSTIFY_LEFT</tt>,
<tt class="literal">gtk.JUSTIFY_RIGHT</tt>, <tt class="literal">gtk.JUSTIFY_CENTER</tt>
or <tt class="literal">gtk.JUSTIFY_FILL</tt>. See <a href="class-gtklabel.html#method-gtklabel--set-justify" title="gtk.Label.set_justify"><tt class="methodname">set_justify</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-pattern"></a><h3>gtk.Label.set_pattern</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_pattern</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>pattern</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>pattern</tt></b>:</span></td><td>the pattern of underlines</td></tr></tbody></table><p>The <tt class="methodname">set_pattern</tt>() method sets the
"pattern" property with the value of <i class="parameter"><tt>pattern</tt></i>. The
pattern contains an underscore or space for each character in the label
text. Any characters omitted are assumed to be spaces. For example, if the
label text is "XXX Label" and the pattern is "___" then only the "XXX" will
be underlined.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-line-wrap"></a><h3>gtk.Label.set_line_wrap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_line_wrap</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>wrap</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>wrap</tt></b>:</span></td><td>if TRUE the label lines will wrap if too big
for the widget size.</td></tr></tbody></table><p>The <tt class="methodname">set_wrap</tt>() method sets the "wrap"
property tot he value of <i class="parameter"><tt>wrap</tt></i>. If
<i class="parameter"><tt>wrap</tt></i> is <tt class="literal">TRUE</tt> the label text will
wrap if it is wider than the widget size; otherwise, the text gets cut off
at the edge of the widget.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-line-wrap"></a><h3>gtk.Label.get_line_wrap</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_line_wrap</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the lines of the
label are automatically wrapped.</td></tr></tbody></table><p>The <tt class="methodname">get_line_wrap</tt>() method returns the
value of the "wrap" property. If "wrap" is <tt class="literal">TRUE</tt> the lines
in the label are automatically wrapped. See <a href="class-gtklabel.html#method-gtklabel--set-line-wrap" title="gtk.Label.set_line_wrap"><tt class="methodname">set_line_wrap</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-selectable"></a><h3>gtk.Label.set_selectable</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_selectable</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>setting</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>setting</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> allow the text in
the label to be selected</td></tr></tbody></table><p>The <tt class="methodname">set_selectable</tt>() method sets the
"selectable" property with the value of <i class="parameter"><tt>setting</tt></i>. If
<i class="parameter"><tt>setting</tt></i> is <tt class="literal">TRUE</tt> the user is
allowed to select text from the label, for copy-and-paste.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-selectable"></a><h3>gtk.Label.get_selectable</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_selectable</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td><tt class="literal">TRUE</tt> if the user can select
the label text</td></tr></tbody></table><p>The <tt class="methodname">get_selectable</tt>() method gets the
value of the "selectable" property set by the <a href="class-gtklabel.html#method-gtklabel--set-selectable" title="gtk.Label.set_selectable"><tt class="methodname">set_selectable</tt>()</a>
method.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--select-region"></a><h3>gtk.Label.select_region</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">select_region</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>start_offset</tt></b></span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>end_offset</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>start_offset</tt></b>:</span></td><td>start offset in characters</td></tr><tr><td><span class="term"><b class="parameter"><tt>end_offset</tt></b>:</span></td><td>end offset in characters</td></tr></tbody></table><p>The <tt class="methodname">select_region</tt>() method selects a
range of characters in the label, if the label is selectable. The selected
region is the range of characters between
<i class="parameter"><tt>start_offset</tt></i> and <i class="parameter"><tt>end_offset</tt></i>.
See <a href="class-gtklabel.html#method-gtklabel--set-selectable" title="gtk.Label.set_selectable"><tt class="methodname">set_selectable</tt>()</a>.
If the label is not selectable, this method has no effect. If
<i class="parameter"><tt>start_offset</tt></i> or <i class="parameter"><tt>end_offset</tt></i> are
-1, then the end of the label will be substituted.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-selection-bounds"></a><h3>gtk.Label.get_selection_bounds</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_selection_bounds</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the start and end character
offsets of the selection</td></tr></tbody></table><p>The <tt class="methodname">get_selection_bounds</tt>() method
returns a tuple that contains the start and end character offsets of the
selected text in the label if the selection exists. If there is no selection
or the label is not selectable, an empty tuple is returned.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-layout"></a><h3>gtk.Label.get_layout</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_layout</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a> for
this label</td></tr></tbody></table><p>The <tt class="methodname">get_layout</tt>() method returns the
<a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
used to display the label. The layout is useful to e.g. convert text
positions to pixel positions, in combination with <a href="class-gtklabel.html#method-gtklabel--get-layout-offsets" title="gtk.Label.get_layout_offsets"><tt class="methodname">get_layout_offsets</tt>()</a>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-layout-offsets"></a><h3>gtk.Label.get_layout_offsets</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_layout_offsets</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a tuple containing the X offset of the layout,
or <tt class="literal">None</tt> and the Y offset of layout, or
<tt class="literal">None</tt></td></tr></tbody></table><p>The <tt class="methodname">get_layout_offsets</tt>() method returns
a tuple containing the coordinates where the label will draw the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
representing the text in the label. This method is useful for converting
mouse events into coordinates inside the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>, e.g.
to take some action if some part of the label is clicked. Of course you will
need to create a <a href="class-gtkeventbox.html" title="gtk.EventBox"><tt class="classname">gtk.EventBox</tt></a> to
receive the events, and pack the label inside it, since labels are a
"windowless" (<tt class="literal">gtk.NO_WINDOW</tt>) widget. Remember when using
the <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>
functions you need to convert to and from pixels using
<tt class="function">pango.PIXELS()</tt> or
<tt class="literal">pango.SCALE</tt>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-ellipsize"></a><h3>gtk.Label.set_ellipsize</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_ellipsize</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>mode</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>mode</tt></b>:</span></td><td>one of the <a href="pango-constants.html#pango-ellipsize-mode-constants">Pango Ellipsize Mode Constants</a> to
use</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_ellipsize</tt>() method sets the
"ellipsize" property to the value of
<i class="parameter"><tt>mode</tt></i>. <i class="parameter"><tt>mode</tt></i> should be one of
the <a href="pango-constants.html#pango-ellipsize-mode-constants">Pango Ellipsize Mode Constants</a>. The "ellipsize"
property specifies if and where an ellipse should be used if there is not
enough room for the label text.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-ellipsize"></a><h3>gtk.Label.get_ellipsize</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_ellipsize</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the current ellipsize mode</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_ellipsize</tt>() method returns the
value of the "ellipsize" property which contains one of the <a href="pango-constants.html#pango-ellipsize-mode-constants">Pango Ellipsize Mode Constants</a>. The "ellipsize"
property specifies if and where an ellipse should be used if there is not
enough room for the label text.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-width-chars"></a><h3>gtk.Label.set_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_width_chars</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>n_chars</tt></b>:</span></td><td> the new desired width, in
characters.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_width_chars</tt>() method sets the
"width-chars" property to the value of <i class="parameter"><tt>n_chars</tt></i>. The
"width-chars" property specifies the desired width of the label in
characters.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-width-chars"></a><h3>gtk.Label.get_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_width_chars</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the desired width of the label in
characters.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_width_chars</tt>() method returns
the value of the "width-chars" property that specifies the desired width of
the label in characters.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-single-line-mode"></a><h3>gtk.Label.set_single_line_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_single_line_mode</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>single_line_mode</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>single_line_mode</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt> the label is in
single line mode.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_single_line_mode</tt>() method sets
the "single-line-mode" property to the value of
<i class="parameter"><tt>single_line_mode</tt></i>. If
<i class="parameter"><tt>single_line_mode</tt></i> is <tt class="literal">TRUE</tt> the label
is in single line mode where the height of the label does not depend on the
actual text, it is always set to ascent + descent of the font.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-single-line-mode"></a><h3>gtk.Label.get_single_line_mode</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_single_line_mode</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_single_line_mode</tt>() method
returns the value of the "single-line-mode" property. See the <a href="class-gtklabel.html#method-gtklabel--set-single-line-mode" title="gtk.Label.set_single_line_mode"><tt class="methodname">set_single_line_mode</tt>()</a>
method for more information.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-max-width-chars"></a><h3>gtk.Label.set_max_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_max_width_chars</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>n_chars</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>n_chars</tt></b>:</span></td><td> the new desired maximum width, in
characters.</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_max_width_chars</tt>() method sets
the "max-width-chars" property to the value of
<i class="parameter"><tt>n_chars</tt></i>.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-max-width-chars"></a><h3>gtk.Label.get_max_width_chars</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_max_width_chars</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_max_width_chars</tt>() method
returns the value of the "max-width-chars" property which is the desired
maximum width of the label in characters.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--set-angle"></a><h3>gtk.Label.set_angle</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_angle</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>angle</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>angle</tt></b>:</span></td><td> the angle that the baseline of the label makes
with the horizontal, in degrees, measured counterclockwise</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">set_angle</tt>() method sets the "angle"
property to the value of
<i class="parameter"><tt>angle</tt></i>. <i class="parameter"><tt>angle</tt></i> is the angle of
rotation for the label. An angle of 90 reads from from bottom to top, an
angle of 270, from top to bottom. The angle setting for the label is ignored
if the label is selectable, wrapped, or ellipsized.</p></div><div class="refsect2" lang="en"><a name="method-gtklabel--get-angle"></a><h3>gtk.Label.get_angle</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_angle</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td></td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.6 and above.</p></div><p>The <tt class="methodname">get_angle</tt>() method returns the
value of the "angle" property. See the <a href="class-gtklabel.html#method-gtklabel--set-angle" title="gtk.Label.set_angle"><tt class="methodname">set_angle</tt>()</a>
method for more information.</p></div></div><div class="refsect1" lang="en"><a name="id3456665"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtklabel--copy-clipboard"></a><h3>The "copy-clipboard" gtk.Label Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>label</tt></i>:</span></td><td>the label that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "copy-clipboard" signal is emitted when text is copied from
the label to the clipboard.</p></div><div class="refsect2" lang="en"><a name="signal-gtklabel--move-cursor"></a><h3>The "move-cursor" gtk.Label Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>step</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>count</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>extend_selection</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>label</tt></i>:</span></td><td>the label that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>step</tt></i>:</span></td><td>the step size of the move:
<tt class="literal">gtk.MOVEMENT_LOGICAL_POSITIONS</tt>,
<tt class="literal">gtk.MOVEMENT_VISUAL_POSITIONS</tt>,
<tt class="literal">gtk.MOVEMENT_WORDS</tt>,
<tt class="literal">gtk.MOVEMENT_DISPLAY_LINES</tt>,
<tt class="literal">gtk.MOVEMENT_DISPLAY_LINE_ENDS</tt>,
<tt class="literal">gtk.MOVEMENT_PARAGRAPHS</tt>,
<tt class="literal">gtk.MOVEMENT_PARAGRAPH_ENDS</tt>,
<tt class="literal">gtk.MOVEMENT_PAGES</tt> and
<tt class="literal">gtk.MOVEMENT_BUFFER_ENDS</tt></td></tr><tr><td><span class="term"><i class="parameter"><tt>count</tt></i>:</span></td><td>the number of steps to
take</td></tr><tr><td><span class="term"><i class="parameter"><tt>extend_selection</tt></i>:</span></td><td>if <tt class="literal">TRUE</tt> extend the range of
the selection</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "move-cursor" signal is emitted when the cursor is being
moved <i class="parameter"><tt>count</tt></i> steps or size <tt class="literal">step</tt>.
The step size is one of:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">
gtk.MOVEMENT_LOGICAL_POSITIONS, move by graphemes
gtk.MOVEMENT_VISUAL_POSITIONS, move by graphemes
gtk.MOVEMENT_WORDS, move by words
gtk.MOVEMENT_DISPLAY_LINES, move by lines(wrapped lines)
gtk.MOVEMENT_DISPLAY_LINE_ENDS, move to line ends(wrapped lines)
gtk.MOVEMENT_PARAGRAPHS, move by paragraphs(newline-ended lines)
gtk.MOVEMENT_PARAGRAPH_ENDS, move to ends of a paragraph
gtk.MOVEMENT_PAGES, move by pages
gtk.MOVEMENT_BUFFER_ENDS move to ends of the buffer
</pre></td></tr></table><p>If <i class="parameter"><tt>extend_selection</tt></i> is
<tt class="literal">TRUE</tt> the selection will be extended to include the text
moved over.</p></div><div class="refsect2" lang="en"><a name="signal-gtklabel--populate-popup"></a><h3>The "populate-popup" gtk.Label Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>label</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>menu</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>label</tt></i>:</span></td><td>the label that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>menu</tt></i>:</span></td><td>the menu to be populated</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><p>The "populate-popup" signal is emitted when a menu needs to be
populated on the fly.</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-gtkitemfactory.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-gtklayout.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.ItemFactory</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.Layout</td></tr></table></div></body></html>
|