summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gtktexttag.xml
blob: 0567b87c0564c993624a4411e2dbe7a2925e8f83 (plain)
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gtktexttag">
  <refnamediv>
    <refname>gtk.TextTag</refname>
    <refpurpose>an object used to apply attributes to text in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link></refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TextTag</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gtktexttag">gtk.TextTag</link></methodname>
	<methodparam><parameter role="keyword">name</parameter>
	  <initializer>None</initializer></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktexttag--get-priority">get_priority</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktexttag--set-priority">set_priority</link></methodname>
	<methodparam><parameter
		       role="keyword">priority</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktexttag--event">event</link></methodname>
	<methodparam><parameter
		       role="keyword">event_object</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">event</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtktexttag">gtk.TextTag</link>
</synopsis>

  </refsect1>

  <refsect1 id="properties-gtktexttag">
    <title>gtk.TextTag Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"accumulative-margin"</entry>
	      <entry>Read-Write</entry>
	      <entry>Whether the margins accumulate or override each other. When set to
          <literal>True</literal> the margins of this tag are added to the margins
          of any other non-accumulative margins present. When set to
          <literal>False</literal> the margins override one another (the default).
          Default value: <literal>False</literal>
          This property is available in GTK+ 2.12 and above.</entry>
	    </row>
        
        <row valign="top">
	      <entry>"background"</entry>
	      <entry>Write</entry>
	      <entry>The background color as a string</entry>
	    </row>

	    <row valign="top">
	      <entry>"background-full-height"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the background color fills
the entire line height</entry>
	    </row>

	    <row valign="top">
	      <entry>"background-full-height-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects background
height</entry>
	    </row>

	    <row valign="top">
	      <entry>"background-gdk"</entry>
	      <entry>Read-Write</entry>
	      <entry>The background color as a (possibly unallocated) <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></entry>
	    </row>

	    <row valign="top">
	      <entry>"background-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
background color</entry>
	    </row>

	    <row valign="top">
	      <entry>"background-stipple"</entry>
	      <entry>Read-Write</entry>
	      <entry>The bitmap to use as a mask when drawing the text
background</entry>
	    </row>

	    <row valign="top">
	      <entry>"background-stipple-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
background stipple</entry>
	    </row>

	    <row valign="top">
	      <entry>"direction"</entry>
	      <entry>Read-Write</entry>
	      <entry>The text direction:
<literal>gtk.TEXT_DIR_NONE</literal>, <literal>gtk.TEXT_DIR_LTR</literal> or
<literal>gtk.TEXT_DIR_RTL</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"editable"</entry>
	      <entry>Read-Write</entry>
	      <entry>It <literal>True</literal> the text can be modified by
the user</entry>
	    </row>

	    <row valign="top">
	      <entry>"editable-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects text
editability</entry>
	    </row>

	    <row valign="top">
	      <entry>"family"</entry>
	      <entry>Read-Write</entry>
	      <entry>The name of the font family, e.g. Sans, Helvetica,
Times, Monospace</entry>
	    </row>

	    <row valign="top">
	      <entry>"family-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
family</entry>
	    </row>

	    <row valign="top">
	      <entry>"font"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font description as a string, e.g. "Sans Italic
12"</entry>
	    </row>

	    <row valign="top">
	      <entry>"font-desc"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font description as a pango.FontDescription
object</entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground"</entry>
	      <entry>Write</entry>
	      <entry>The foreground color as a string</entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground-gdk"</entry>
	      <entry>Read-Write</entry>
	      <entry>The foreground color as a (possibly unallocated) <link
linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link></entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
foreground color</entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground-stipple"</entry>
	      <entry>Read-Write</entry>
	      <entry>The bitmap to use as a mask when drawing the text
foreground</entry>
	    </row>

	    <row valign="top">
	      <entry>"foreground-stipple-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
foreground stipple</entry>
	    </row>

	    <row valign="top">
	      <entry>"indent"</entry>
	      <entry>Read-Write</entry>
	      <entry>The amount to indent the paragraph, in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"indent-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects
indentation</entry>
	    </row>

	    <row valign="top">
	      <entry>"invisible"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this text is hidden</entry>
	    </row>

	    <row valign="top">
	      <entry>"invisible-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects text
visibility</entry>
	    </row>

	    <row valign="top">
	      <entry>"justification"</entry>
	      <entry>Read-Write</entry>
	      <entry>The text justification:
<literal>gtk.JUSTIFY_LEFT</literal>, <literal>gtk.JUSTIFY_RIGHT</literal>,
<literal>gtk.JUSTIFY_CENTER</literal> or
<literal>gtk.JUSTIFY_FILL</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"justification-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects paragraph
justification</entry>
	    </row>

	    <row valign="top">
	      <entry>"language"</entry>
	      <entry>Read-Write</entry>
	      <entry>The language this text is in, as an ISO code. Pango can
use this as a hint when rendering the text. If you don't understand this
parameter, you probably don't need it.</entry>
	    </row>

	    <row valign="top">
	      <entry>"language-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
language the text is rendered as</entry>
	    </row>

	    <row valign="top">
	      <entry>"left-margin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The width of the left margin in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"left-margin-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the left
margin</entry>
	    </row>

	    <row valign="top">
	      <entry>"name"</entry>
	      <entry>Read-Write</entry>
	      <entry>The name of the texttag or <literal>None</literal> if
anonymous</entry>
	    </row>

            <row valign="top">
              <entry>"paragraph-background"</entry>
              <entry>Write</entry>
              <entry>The paragraph background color as a string.  This
              property is available in GTK+ 2.8 and above.</entry>
            </row>

            <row valign="top">
              <entry>"paragraph-background-gdk"</entry>
              <entry>Read-Write</entry>
              <entry>The paragraph background color as a as a (possibly
              unallocated) <link
              linkend="class-gdkcolor"><classname>gtk.gdk.Color</classname></link>.
              This property is available in GTK+ 2.8 and above.</entry>
            </row>

            <row valign="top">
              <entry>"paragraph-background-set"</entry>
              <entry>Read-Write</entry>
              <entry>if <literal>True</literal> this tag affects the
              paragraph background color</entry>
            </row>

	    <row valign="top">
	      <entry>"pixels-above-lines"</entry>
	      <entry>Read-Write</entry>
	      <entry>The number of pixels of blank space above
paragraphs</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels-above-lines-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the number
of pixels above lines</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels-below-lines"</entry>
	      <entry>Read-Write</entry>
	      <entry>The number of pixels of blank space below
paragraphs</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels-below-lines-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the number
of pixels above lines</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels-inside-wrap"</entry>
	      <entry>Read-Write</entry>
	      <entry>The number of pixels of blank space between wrapped
lines in a paragraph</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels-inside-wrap-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the number
of pixels between wrapped lines</entry>
	    </row>

	    <row valign="top">
	      <entry>"right-margin"</entry>
	      <entry>Read-Write</entry>
	      <entry>The width of the right margin in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"right-margin-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the right
margin</entry>
	    </row>

	    <row valign="top">
	      <entry>"rise"</entry>
	      <entry>Read-Write</entry>
	      <entry>The offset of text above the baseline (below the
baseline if rise is negative) in pixels</entry>
	    </row>

	    <row valign="top">
	      <entry>"rise-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the
rise</entry>
	    </row>

	    <row valign="top">
	      <entry>"scale"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font size as a scale factor relative to the default
font size. This properly adapts to theme changes etc. so is recommended.
Pango predefines some scales such as
<literal>pango.SCALE_XX_SMALL</literal>,
<literal>pango.SCALE_X_SMALL</literal>,
<literal>pango.SCALE_SMALL</literal>, <literal>pango.SCALE_MEDIUM</literal>,
<literal>pango.SCALE_LARGE</literal>,
<literal>pango.SCALE_X_LARGE</literal>,
<literal>pango.SCALE_XX_LARGE</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"scale-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag scales the font
size by a factor</entry>
	    </row>

	    <row valign="top">
	      <entry>"size"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font size in Pango units.</entry>
	    </row>

	    <row valign="top">
	      <entry>"size-points"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font size in points</entry>
	    </row>

	    <row valign="top">
	      <entry>"size-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
size</entry>
	    </row>

	    <row valign="top">
	      <entry>"stretch"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font stretch - one of:
<literal>pango.STRETCH_ULTRA_CONDENSED</literal>,
<literal>pango.STRETCH_EXTRA_CONDENSED</literal>,
<literal>pango.STRETCH_CONDENSED</literal>,
<literal>pango.STRETCH_SEMI_CONDENSED</literal>,
<literal>pango.STRETCH_NORMAL</literal>,
<literal>pango.STRETCH_SEMI_EXPANDED</literal>,
<literal>pango.STRETCH_EXPANDED</literal>,
<literal>pango.STRETCH_EXTRA_EXPANDED</literal>,
<literal>pango.STRETCH_ULTRA_EXPANDED</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"stretch-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
stretch</entry>
	    </row>

	    <row valign="top">
	      <entry>"strikethrough"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, strike through the
text</entry>
	    </row>

	    <row valign="top">
	      <entry>"strikethrough-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects
strikethrough</entry>
	    </row>

	    <row valign="top">
	      <entry>"style"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font style - one of:
<literal>pango.STYLE_NORMAL</literal>,
<literal>pango.STYLE_OBLIQUE</literal> or
<literal>pango.STYLE_ITALIC</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"style-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
style</entry>
	    </row>

	    <row valign="top">
	      <entry>"tabs"</entry>
	      <entry>Read-Write</entry>
	      <entry>The custom tabs for this text</entry>
	    </row>

	    <row valign="top">
	      <entry>"tabs-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects
tabs</entry>
	    </row>

	    <row valign="top">
	      <entry>"underline"</entry>
	      <entry>Read-Write</entry>
	      <entry>The style of underline for this text:
<literal>pango.UNDERLINE_NONE</literal>,
<literal>pango.UNDERLINE_SINGLE</literal>,
<literal>pango.UNDERLINE_DOUBLE</literal> or
<literal>pango.UNDERLINE_LOW</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"underline-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects
underlining</entry>
	    </row>

	    <row valign="top">
	      <entry>"variant"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font variant - either
<literal>pango.VARIANT_NORMAL</literal> or
<literal>pango.VARIANT_SMALL_CAPS</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"variant-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
variant</entry>
	    </row>

	    <row valign="top">
	      <entry>"weight"</entry>
	      <entry>Read-Write</entry>
	      <entry>The font weight as an integer:
<literal>pango.WEIGHT_ULTRALIGHT</literal> = 200,
<literal>pango.WEIGHT_LIGHT</literal> = 300,
<literal>pango.WEIGHT_NORMAL</literal> = 400,
<literal>pango.WEIGHT_BOLD</literal> = 700,
<literal>pango.WEIGHT_ULTRABOLD</literal> = 800,
<literal>pango.WEIGHT_HEAVY</literal> = 900.</entry>
	    </row>

	    <row valign="top">
	      <entry>"weight-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects the font
weight</entry>
	    </row>

	    <row valign="top">
	      <entry>"wrap-mode"</entry>
	      <entry>Read-Write</entry>
	      <entry>The wrap mode of the text:
<literal>gtk.WRAP_NONE</literal>, <literal>gtk.WRAP_CHAR</literal> or
<literal>gtk.WRAP_WORD</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"wrap-mode-set"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, this tag affects line wrap
mode</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtktexttag">
    <title>gtk.TextTag Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>

    <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtktexttag--event">event</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>texttag</parameter></methodparam>
            <methodparam><parameter>widget</parameter></methodparam>
            <methodparam><parameter>event</parameter></methodparam>
            <methodparam><parameter>iter</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> object
holds attributes that can be applied to a range of text in a <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>.
A texttag can be associated with more than one <link
linkend="class-gtktextbuffer"><classname>gtk.TextBuffer</classname></link>
by adding it to the <link
linkend="class-gtktexttagtable"><classname>gtk.TextTagTable</classname></link> 
objects of the textbuffers. The attributes of a texttag can be set using the
<link
linkend="method-gobject--set-property"><methodname>GObject.set_property</methodname>()</link> 
method  or as part of texttag creation using the <link
linkend="method-gtktextbuffer--create-tag"><methodname>gtk.TextBuffer.create_tag</methodname>()</link> 
method. Since not every attribute property of a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> may be
set each attribute property has a boolean property that indicates whether
the attribute property is set by this texttag. Therefore before retrieving
an attribute value from a texttag you have to check if the associated
boolean property of the attribute property is
<literal>True</literal>.</para>

  </refsect1>

  <refsect1 id="constructor-gtktexttag">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.TextTag</methodname>
	<methodparam><parameter
		       role="keyword">name</parameter>
	  <initializer>None</initializer></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">name</parameter>&nbsp;:</term>
	<listitem><simpara>tag name, or <literal>None</literal> if the
texttag is anonymous</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link></simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> with
the name specified by <parameter>name</parameter>. If
<parameter>name</parameter> is <literal>None</literal> the texttag will be
anonymous. The texttag attributes are configured using the <link
linkend="method-gobject--set-property"><methodname>GObject.set_property</methodname>()</link> 
method.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktexttag--get-priority">
      <title>gtk.TextTag.get_priority</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_priority</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the texttag's priority.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The get_priority() method returns the priority or the
texttag.</para>

    </refsect2>

    <refsect2 id="method-gtktexttag--set-priority">
      <title>gtk.TextTag.set_priority</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_priority</methodname>
	  <methodparam><parameter
			 role="keyword">priority</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">priority</parameter>&nbsp;:</term>
	  <listitem><simpara>the new priority</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_priority</methodname>() method sets the
priority of a <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> to the
value specified by <parameter>priority</parameter>. Valid priorities start
at 0 and go to one less than the value returned by the <link
linkend="method-gtktexttagtable--get-size"><methodname>gtk.TextTagTable.get_size</methodname>()</link> 
method. Each texttag in a table has a unique priority; setting the priority
of one texttag shifts the priorities of all the other texttags in the table
to maintain a unique priority for each texttag. Higher priority tags "win"
if two texttags both set the same text attribute for a range of text. When
adding a texttag to a <link
linkend="class-gtktexttagtable"><classname>gtk.TextTagTable</classname></link>, 
it will be assigned the highest priority in the table by default; so
normally the precedence of a set of texttags is the order in which they were
added to the table, or created with the <link
linkend="method-gtktextbuffer--create-tag"><methodname>gtk.TextBuffer.create_tag</methodname>()</link> 
method, that adds the texttag to the buffer's table automatically.</para>

    </refsect2>

    <refsect2 id="method-gtktexttag--event">
      <title>gtk.TextTag.event</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>event</methodname>
	  <methodparam><parameter
			 role="keyword">event_object</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">event</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">event_object</parameter>&nbsp;:</term>
	  <listitem><simpara>the object that received the event, such as a
widget</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">event</parameter>&nbsp;:</term>
	  <listitem><simpara>the event</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the location where the event was
received</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the result of signal emission (whether the
event was handled)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>event</methodname>() method emits the "event"
signal on the <link
linkend="class-gtktexttag"><classname>gtk.TextTag</classname></link> for the
widget specified by <parameter>event_object</parameter> with the event
specified by <parameter>event</parameter> at the textbuffer location
specified by <parameter>iter</parameter>. This method returns
<literal>True</literal> if the event was handled.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtktexttag--event">
      <title>The "event" gtk.TextTag Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>texttag</parameter></methodparam>
	  <methodparam><parameter>widget</parameter></methodparam>
	  <methodparam><parameter>event</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>texttag</parameter>&nbsp;:</term>
	  <listitem><simpara>the texttag that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>widget</parameter>&nbsp;:</term>
	  <listitem><simpara>the widget that received
<parameter>event</parameter></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>event</parameter>&nbsp;:</term>
	  <listitem><simpara>the event</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktextiter"><classname>gtk.TextIter</classname></link>
pointing to the location where the event was received</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The "event" signal is emitted when an event occurs in a range of
text that is enclosed in the <parameter>texttag</parameter>. The widget that
the event occurred in is specified by <parameter>widget</parameter>.
<parameter>iter</parameter> holds the location that the event occurred at
and <parameter>event</parameter> describes the event.</para>

    </refsect2>

  </refsect1>

</refentry>