File: pygtk-gtktreeselection.xml

package info (click to toggle)
pygtk 2.24.0-5.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 26,760 kB
  • ctags: 8,260
  • sloc: xml: 182,079; sh: 10,297; python: 10,161; ansic: 2,861; makefile: 1,358
file content (827 lines) | stat: -rw-r--r-- 31,638 bytes parent folder | download | duplicates (5)
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
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
<?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-gtktreeselection">
  <refnamediv>
    <refname>gtk.TreeSelection</refname>
    <refpurpose>the selection object for <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link></refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TreeSelection</classname></ooclass>
      <ooclass><classname><link
linkend="class-gtkobject">gtk.Object</link></classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--set-mode">set_mode</link></methodname>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-mode">get_mode</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--set-select-function">set_select_function</link></methodname>
	<methodparam><parameter
		       role="keyword">func</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">data</parameter>
	  <initializer>None</initializer></methodparam>
	<methodparam><parameter
		       role="keyword">full</parameter>
	  <initializer>False</initializer></methodparam>
      </methodsynopsis>

<!-- NOT IMPLEMENTED
<methodsynopsis language="python">
    <methodname><link linkend="method-gtktreeselection- -get-user-data">get_user_data</link></methodname>
    <methodparam></methodparam>  </methodsynopsis>
END NOT IMPLEMENTED -->

      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-tree-view">get_tree_view</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--get-selected">get_selected</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--get-selected-rows">get_selected_rows</link></methodname>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--count-selected-rows">count_selected_rows</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--selected-foreach">selected_foreach</link></methodname>
	<methodparam><parameter>func</parameter></methodparam>
	<methodparam><parameter>data</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-path">select_path</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-path">unselect_path</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-iter">select_iter</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-iter">unselect_iter</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--path-is-selected">path_is_selected</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--iter-is-selected">iter_is_selected</link></methodname>
	<methodparam><parameter
		       role="keyword">iter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-all">select_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--unselect-all">unselect_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreeselection--select-range">select_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start_path</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">end_path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtktreeselection--unselect-range">unselect_range</link></methodname>
	<methodparam><parameter
		       role="keyword">start_path</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">end_path</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkobject">gtk.Object</link>
    +-- <link linkend="class-gtktreeselection">gtk.TreeSelection</link>
</synopsis>

  </refsect1>

  <refsect1 id="signal-prototypes-gtktreeselection">
    <title>gtk.TreeSelection Signal Prototypes</title>

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

    <variablelist>
      <varlistentry>
        <term>"<link
linkend="signal-gtktreeselection--changed">changed</link>"</term>
        <listitem>
          <methodsynopsis
	    language="python"><methodname>callback</methodname>
            <methodparam><parameter>treeselection</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is a helper object to manage the selection for a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget. The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is automatically created when a new <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget is created, and cannot exist independent of this widget. The primary
reason the <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object exists is for cleanliness of code and API. That is, there is no
conceptual reason all these functions could not be methods on the <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
widget instead of a separate function. The <link
linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>
object is retrieved from a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link> by
calling the <link
linkend="method-gtktreeview--get-selection"><methodname>gtk.TreeView.get_selection</methodname>()</link>
method. It can be manipulated to check the selection status of the tree, as
well as select and deselect individual rows. Selection is done completely on
the view side. As a result, multiple views of the same model can have
completely different selections. Additionally, you cannot change the
selection of a row on the model that is not currently displayed by the view
without expanding its parents first.</para>

    <para>One of the important things to remember when monitoring the
selection of a view is that the "changed" signal is mostly a hint. That is,
it may only emit one signal when a range of rows is selected. Additionally,
it may on occasion emit a "changed" signal when nothing has happened (mostly
as a result of programmers calling the <link
linkend="method-gtktreeselection--select-path"><methodname>select_path</methodname>()</link>
or <link
linkend="method-gtktreeselection--select-iter"><methodname>select_iter</methodname>()</link>
methods on an already selected row).</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktreeselection--set-mode">
      <title>gtk.TreeSelection.set_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_mode</methodname>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_mode</methodname>() method sets the
selection mode of the treeselection to the mode specified by
<parameter>type</parameter>. The value of <parameter>type</parameter> must
be one of: <literal>gtk.SELECTION_NONE</literal>,
<literal>gtk.SELECTION_SINGLE</literal>,
<literal>gtk.SELECTION_BROWSE</literal> or
<literal>gtk.SELECTION_MULTIPLE</literal>. See the <xref
linkend="gtk-selection-mode-constants"
endterm="gtk-selection-mode-constants-title"></xref> description for more
detail.</para>

      <para>If the previous type was
<literal>gtk.SELECTION_MULTIPLE</literal>, then the anchor is kept selected,
if it was previously selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-mode">
      <title>gtk.TreeSelection.get_mode</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_mode</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current selection mode</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_mode</methodname>() method returns the
selection mode for treeselection. See the <link
linkend="method-gtktreeselection--set-mode"><methodname>set_mode</methodname>()</link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--set-select-function">
      <title>gtk.TreeSelection.set_select_function</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_select_function</methodname>
	  <methodparam><parameter
		       role="keyword">func</parameter></methodparam>
	  <methodparam><parameter
		       role="keyword">data</parameter><initializer>None</initializer></methodparam>
	  <methodparam><parameter
		       role="keyword">full</parameter><initializer>False</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>func</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection function.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>data</parameter>&nbsp;:</term>
	  <listitem><simpara>the selection function's
data.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>full</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>
	  <parameter>func</parameter> will be passed a full set of
	  args</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_selection_function</methodname>() method
sets the selection function to <parameter>func</parameter> (a function or
method). If the selection function is set, it is called before any node is
selected or unselected, giving some control over which nodes are selected.
The selection function should return <literal>True</literal> if the state of
the node may be toggled, and <literal>False</literal> if the state of the
node should be left unchanged. The signature of the selection function
callback is:</para>

<programlisting>
  <methodsynopsis language="python">
    <methodname>selectfunction</methodname>
    <methodparam><parameter>info</parameter></methodparam>
  </methodsynopsis>
  <methodsynopsis language="python">
    <methodname>selectmethod</methodname>
    <methodparam><parameter>self</parameter></methodparam>
    <methodparam><parameter>info</parameter></methodparam>
  </methodsynopsis>
</programlisting>

<para>where <parameter>info</parameter> is a tuple containing a path or a
path and <parameter>data</parameter> if <parameter>data</parameter> was
passed to the <link
linkend="method-gtktreeselection--set-select-function"><methodname>set_select_function</methodname>()</link>
method.</para>

<para>In PyGTK 2.10 and above if the additional optional parameter
<parameter>full</parameter> is <literal>True</literal> the signature of
<parameter>func</parameter> should be:</para>

<programlisting>
<methodsynopsis language="python">
	  <methodname>selectfunction</methodname>
	  <methodparam><parameter>selection</parameter></methodparam>
	  <methodparam><parameter>model</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>path_currently_selected</parameter></methodparam>
	  <methodparam><parameter>user_data</parameter></methodparam>
	</methodsynopsis>
<methodsynopsis language="python">
	  <methodname>selectmethod</methodname>
	  <methodparam><parameter>self</parameter></methodparam>
	  <methodparam><parameter>selection</parameter></methodparam>
	  <methodparam><parameter>model</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>is_selected</parameter></methodparam>
	  <methodparam><parameter>user_data</parameter></methodparam>
	</methodsynopsis>
</programlisting>

      <para>where <parameter>selection</parameter> is the <link
      linkend="class-gtktreeselection"><classname>gtk.TreeSelection</classname></link>,
      <parameter>model</parameter> is the <link
      linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
      used by the <link
      linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
      associated with selection, <parameter>path</parameter> is the path of
      the selected row, <parameter>is_selected</parameter> is
      <literal>True</literal> if the row is currently selected and
      <parameter>user_data</parameter> is <parameter>data</parameter> if any
      (may not be present if <parameter>data</parameter> was
      <literal>None</literal>). If <parameter>func</parameter> is a method
      then <parameter>self</parameter> is the object that the method is
      called upon.</para>

    </refsect2>

<!-- NOT IMPLEMENTED
    <refsect2 id="method-gtktreeselection- -get-user-data">
    <title>gtk.TreeSelection.get_user_data</title>

<programlisting><methodsynopsis language="python">
    <methodname>get_user_data</methodname>
    <methodparam></methodparam>
  </methodsynopsis></programlisting>
  <variablelist>
    <varlistentry>
      <term><emphasis>Returns</emphasis>&nbsp;:</term>
      <listitem><simpara>the user data.</simpara></listitem>
    </varlistentry>
  </variablelist>

      <para>Returns the user data for the selection function.
</para>  </refsect2>
END NOT IMPLEMENTED -->

    <refsect2 id="method-gtktreeselection--get-tree-view">
      <title>gtk.TreeSelection.get_tree_view</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_tree_view</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_tree_iter</methodname>() method returns the
tree view associated with the treeselection.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-selected">
      <title>gtk.TreeSelection.get_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_selected</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing a reference to the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link> and
a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing to the currently selected node.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_selected</methodname>() method returns a
2-tuple containing the treemodel and a treeiter pointing to the selected node
in the treemodel if the treeselection is set to
<literal>gtk.SELECTION_SINGLE</literal> or
<literal>gtk.SELECTION_BROWSE</literal>. The returned <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> will
be <literal>None</literal> if there is no row selected. This method will not
work if you use <parameter>selection</parameter> is
<literal>gtk.SELECTION_MULTIPLE</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--get-selected-rows">
      <title>gtk.TreeSelection.get_selected_rows</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_selected_rows</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a 2-tuple containing the tree model and a list
	  of the tree paths of all selected rows.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_selected_rows</methodname>() method returns
a 2-tuple containing a <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link> and
a list of the tree paths of all selected rows. Additionally, if you are
planning on modifying the tree model after calling this method, you may want
to convert the returned list into a list of <link
linkend="class-gtktreerowreference"><classname>gtk.TreeRowReference</classname></link>
objects.  To do this, you can use the <link
linkend="constructor-gtktreerowreference">gtk.TreeRowReference</link>()
constructor.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--count-selected-rows">
      <title>gtk.TreeSelection.count_selected_rows</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>count_selected_rows</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The number of rows selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>count_selected_rows</methodname>() method
returns the number of rows that have been selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--selected-foreach">
      <title>gtk.TreeSelection.selected_foreach</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>selected_foreach</methodname>
	  <methodparam><parameter>func</parameter></methodparam>
	  <methodparam><parameter>data</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>func</parameter>&nbsp;:</term>
	  <listitem><simpara>the function or method to call for each
selected node.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>data</parameter>&nbsp;:</term>
	  <listitem><simpara>the user data to pass to
<parameter>func</parameter>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>selected_foreach</methodname>() method calls the
function or method specified by <parameter>func</parameter> for each
selected node passing the user data specified by
<parameter>data</parameter>. The signature of <parameter>func</parameter>
is:</para>

      <programlisting>
<methodsynopsis language="python">
	  <methodname>foreachfunction</methodname>
	  <methodparam><parameter>treemodel</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis>
<methodsynopsis language="python">
	  <methodname>foreachmethod</methodname>
	  <methodparam><parameter>self</parameter></methodparam>
	  <methodparam><parameter>treemodel</parameter></methodparam>
	  <methodparam><parameter>path</parameter></methodparam>
	  <methodparam><parameter>iter</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis>
</programlisting>

      <para>where <parameter>treemodel</parameter> is the <link
linkend="class-gtktreemodel"><classname>gtk.TreeModel</classname></link>
being viewed, <parameter>path</parameter> is the path of the selected row,
<parameter>iter</parameter> is a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
pointing to the selected row and <parameter>...</parameter> is the user data
if any (may not be present if <parameter>data</parameter> was
<literal>None</literal>). If <parameter>func</parameter> is a method then
<parameter>self</parameter> is the object that the method is called
upon.</para>

      <note>
        <para>You cannot modify the tree or selection in the callback
function.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-path">
      <title>gtk.TreeSelection.select_path</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_path</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the tree path to be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_path</methodname>() method selects the
row at <parameter>path</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-path">
      <title>gtk.TreeSelection.unselect_path</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_path</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the tree path to be
unselected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>unselect_path</methodname>() method unselects
the row at <parameter>path</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-iter">
      <title>gtk.TreeSelection.select_iter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_iter</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> to be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_iter</methodname>() method selects the
row pointed to by the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
specified by <parameter>iter</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-iter">
      <title>gtk.TreeSelection.unselect_iter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_iter</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link> to be
unselected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>unselect_iter</methodname>() method unselects
the row pointed to by the <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link>
specified by <parameter>iter</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--path-is-selected">
      <title>gtk.TreeSelection.path_is_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>path_is_selected</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>A tree path to check if
selected.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if
<parameter>path</parameter> is selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>path_is_selected</methodname>() method returns
<literal>True</literal> if the row pointed to by <parameter>path</parameter>
is currently selected.  If <parameter>path</parameter> does not point to a
valid location, <literal>False</literal> is returned.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--iter-is-selected">
      <title>gtk.TreeSelection.iter_is_selected</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>iter_is_selected</methodname>
	  <methodparam><parameter
			 role="keyword">iter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">iter</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtktreeiter"><classname>gtk.TreeIter</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal>, if the row pointed to
by <parameter>iter</parameter> is selected</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>iter_is_selected</methodname>() method returns
<literal>True</literal> if the row pointed to by <parameter>iter</parameter>
is currently selected.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-all">
      <title>gtk.TreeSelection.select_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_all</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <para>The <methodname>select_all</methodname>() method selects all the
nodes.  The treeselection is must be set to
<literal>gtk.SELECTION_MULTIPLE</literal> mode.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-all">
      <title>gtk.TreeSelection.unselect_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_all</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <para>The <methodname>unselect_all</methodname>() method unselects all
the nodes.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--select-range">
      <title>gtk.TreeSelection.select_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_range</methodname>
	  <methodparam><parameter
			 role="keyword">start_path</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">end_path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">start_path</parameter>&nbsp;:</term>
	  <listitem><simpara>the initial node path of the
range.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">end_path</parameter>&nbsp;:</term>
	  <listitem><simpara>the final node path of the
range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>select_range</methodname>() method selects a
range of nodes specified by the tree paths
<parameter>start_path</parameter> and <parameter>end_path</parameter>
inclusive.</para>

    </refsect2>

    <refsect2 id="method-gtktreeselection--unselect-range">
      <title>gtk.TreeSelection.unselect_range</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_range</methodname>
	  <methodparam><parameter>start_path</parameter></methodparam>
	  <methodparam><parameter>end_path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter>start_path</parameter>&nbsp;:</term>
	  <listitem><simpara>The initial node of the
	  range.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>end_path</parameter>&nbsp;:</term>
	  <listitem><simpara>The final node of the
	  range.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>unselect_range</methodname>() method unselects
the range of nodes specified by the tree paths
<parameter>start_path</parameter> and <parameter>end_path</parameter>
inclusive.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtktreeselection--changed">
      <title>The "changed" gtk.TreeSelection Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>treeselection</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>treeselection</parameter>&nbsp;:</term>
	  <listitem><simpara>the treeselection that received the
signal</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 "changed" signal is emitted when the selection has
changed.</para>

    </refsect2>

  </refsect1>

</refentry>