File: wx.ListCtrl.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (2658 lines) | stat: -rw-r--r-- 69,260 bytes parent folder | download
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
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.ListCtrl:

==========================================================================================================================================
|phoenix_title|  **wx.ListCtrl**
==========================================================================================================================================

A list control presents lists in a number of formats: list view, report view, icon view and small icon view.          

In any case, elements are numbered from zero. For all these modes, the items are stored in the control and must be added to it using :meth:`wx.ListCtrl.InsertItem`   method. 

A special case of report view quite different from the other modes of the list control is a virtual control in which the items data (including text, images and attributes) is managed by the main program and is requested by the control itself only when needed which allows to have controls with millions of items without consuming much memory. To use virtual list control you must use :meth:`wx.ListCtrl.SetItemCount`   first and override at least :meth:`wx.ListCtrl.OnGetItemText`   (and optionally :meth:`wx.ListCtrl.OnGetItemImage`   or :meth:`wx.ListCtrl.OnGetItemColumnImage`   and :meth:`wx.ListCtrl.OnGetItemAttr` ) to return the information about the items when the control requests it. 

Virtual list control can be used as a normal one except that no operations which can take time proportional to the number of items in the control happen  

Using many of :ref:`wx.ListCtrl`  features is shown in the :ref:`corresponding sample <corresponding sample>`. 

To intercept events from a list control, use the event table macros described in :ref:`wx.ListEvent`. 

**Mac Note**: Starting with wxWidgets 2.8, :ref:`wx.ListCtrl`  uses a native implementation for report mode, and uses a generic implementation for other modes. You can use the generic implementation for report mode as well by setting the  ``mac.listctrl.always_use_generic``   system option (see  :ref:`wx.SystemOptions`) to 1. 





.. _ListCtrl-styles:

|styles| Window Styles
================================

This class supports the following styles: 

  

- ``wx.LC_LIST``: Multicolumn list view, with optional small icons. Columns are computed automatically, i.e. you don't set columns as in  ``LC_REPORT`` . In other words, the list wraps, unlike a  :ref:`wx.ListBox`.  
- ``wx.LC_REPORT``: Single or multicolumn report view, with optional header.  
- ``wx.LC_VIRTUAL``: The application provides items text on demand. May only be used with  ``LC_REPORT`` .   
- ``wx.LC_ICON``: Large icon view, with optional labels.  
- ``wx.LC_SMALL_ICON``: Small icon view, with optional labels.  
- ``wx.LC_ALIGN_TOP``: Icons align to the top. Win32 default, Win32 only.  
- ``wx.LC_ALIGN_LEFT``: Icons align to the left.  
- ``wx.LC_AUTOARRANGE``: Icons arrange themselves. Win32 only.  
- ``wx.LC_EDIT_LABELS``: Labels are editable: the application will be notified when editing starts.  
- ``wx.LC_NO_HEADER``: No header in report mode.  
- ``wx.LC_SINGLE_SEL``: Single selection (default is multiple).  
- ``wx.LC_SORT_ASCENDING``: Sort in ascending order. (You must still supply a comparison callback in :meth:`wx.ListCtrl.SortItems` .)  
- ``wx.LC_SORT_DESCENDING``: Sort in descending order. (You must still supply a comparison callback in :meth:`wx.ListCtrl.SortItems` .)  
- ``wx.LC_HRULES``: Draws light horizontal rules between rows in report mode.  
- ``wx.LC_VRULES``: Draws light vertical rules between columns in report mode.  








.. _ListCtrl-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.ListEvent` parameter.


- EVT_LIST_BEGIN_DRAG: Begin dragging with the left mouse button. Processes a  ``wxEVT_LIST_BEGIN_DRAG``   event type.   
- EVT_LIST_BEGIN_RDRAG: Begin dragging with the right mouse button. Processes a  ``wxEVT_LIST_BEGIN_RDRAG``   event type.   
- EVT_BEGIN_LABEL_EDIT: Begin editing a label. This can be prevented by calling Veto(). Processes a  ``wxEVT_LIST_BEGIN_LABEL_EDIT``   event type.   
- EVT_LIST_END_LABEL_EDIT: Finish editing a label. This can be prevented by calling Veto(). Processes a  ``wxEVT_LIST_END_LABEL_EDIT``   event type.   
- EVT_LIST_DELETE_ITEM: An item was deleted. Processes a  ``wxEVT_LIST_DELETE_ITEM``   event type.   
- EVT_LIST_DELETE_ALL_ITEMS: All items were deleted. Processes a  ``wxEVT_LIST_DELETE_ALL_ITEMS``   event type.   
- EVT_LIST_ITEM_SELECTED: The item has been selected. Processes a  ``wxEVT_LIST_ITEM_SELECTED``   event type.   
- EVT_LIST_ITEM_DESELECTED: The item has been deselected. Processes a  ``wxEVT_LIST_ITEM_DESELECTED``   event type.   
- EVT_LIST_ITEM_ACTIVATED: The item has been activated (``ENTER`` or double click). Processes a  ``wxEVT_LIST_ITEM_ACTIVATED``   event type.   
- EVT_LIST_ITEM_FOCUSED: The currently focused item has changed. Processes a  ``wxEVT_LIST_ITEM_FOCUSED``   event type.   
- EVT_LIST_ITEM_MIDDLE_CLICK: The middle mouse button has been clicked on an item. This is only supported by the generic control. Processes a  ``wxEVT_LIST_ITEM_MIDDLE_CLICK``   event type.   
- EVT_LIST_ITEM_RIGHT_CLICK: The right mouse button has been clicked on an item. Processes a  ``wxEVT_LIST_ITEM_RIGHT_CLICK``   event type.   
- EVT_LIST_KEY_DOWN: A key has been pressed. Processes a  ``wxEVT_LIST_KEY_DOWN``   event type.   
- EVT_LIST_INSERT_ITEM: An item has been inserted. Processes a  ``wxEVT_LIST_INSERT_ITEM``   event type.   
- EVT_LIST_COL_CLICK: A column (m_col) has been left-clicked. Processes a  ``wxEVT_LIST_COL_CLICK``   event type.   
- EVT_LIST_COL_RIGHT_CLICK: A column (m_col) has been right-clicked. Processes a  ``wxEVT_LIST_COL_RIGHT_CLICK``   event type.   
- EVT_LIST_COL_BEGIN_DRAG: The user started resizing a column - can be vetoed. Processes a  ``wxEVT_LIST_COL_BEGIN_DRAG``   event type.   
- EVT_LIST_COL_DRAGGING: The divider between columns is being dragged. Processes a  ``wxEVT_LIST_COL_DRAGGING``   event type.   
- EVT_LIST_COL_END_DRAG: A column has been resized by the user. Processes a  ``wxEVT_LIST_COL_END_DRAG``   event type.   
- EVT_LIST_CACHE_HINT: Prepare cache for a virtual list control. Processes a  ``wxEVT_LIST_CACHE_HINT``   event type.   








         



.. seealso:: :ref:`ListCtrl Overview <listctrl overview>`, :ref:`wx.ListView`, :ref:`wx.ListBox`, :ref:`wx.TreeCtrl`, :ref:`wx.ImageList`, :ref:`wx.ListEvent`, :ref:`wx.ListItem`, :ref:`wx.adv.EditableListBox`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>ListCtrl</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.ListCtrl_inheritance.png" alt="Inheritance diagram of ListCtrl" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ListCtrl.html" title="wx.ListCtrl" alt="" coords="61,315,147,344"/> <area shape="rect" id="node2" href="wx.Control.html" title="wx.Control" alt="" coords="60,237,148,267"/> <area shape="rect" id="node3" href="wx.Window.html" title="wx.Window" alt="" coords="59,160,148,189"/> <area shape="rect" id="node4" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,87,35"/> <area shape="rect" id="node5" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="48,83,159,112"/> <area shape="rect" id="node6" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="112,5,213,35"/> </map> 
   </p>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.listctrl.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/wx.listctrl.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.listctrl.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|


|sub_classes| Known Subclasses
==============================

:ref:`wx.ListView`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.ListCtrl.__init__`                                                    Default constructor.
:meth:`~wx.ListCtrl.Append`                                                      Append an item to the list control.  The `entry` parameter should be a
:meth:`~wx.ListCtrl.AppendColumn`                                                Adds a new column to the list control in report view mode.
:meth:`~wx.ListCtrl.Arrange`                                                     Arranges the items in icon or small icon view.
:meth:`~wx.ListCtrl.AssignImageList`                                             Sets the image list associated with the control and takes ownership of it (i.e.
:meth:`~wx.ListCtrl.ClearAll`                                                    Deletes all items and all columns.
:meth:`~wx.ListCtrl.ClearColumnImage`                                            
:meth:`~wx.ListCtrl.Create`                                                      Creates the list control.
:meth:`~wx.ListCtrl.DeleteAllColumns`                                            Delete all columns in the list control.
:meth:`~wx.ListCtrl.DeleteAllItems`                                              Deletes all items in the list control.
:meth:`~wx.ListCtrl.DeleteColumn`                                                Deletes a column.
:meth:`~wx.ListCtrl.DeleteItem`                                                  Deletes the specified item.
:meth:`~wx.ListCtrl.EditLabel`                                                   Starts editing the label of the given item.
:meth:`~wx.ListCtrl.EnableAlternateRowColours`                                   Enable alternating row background colours (also called zebra striping).
:meth:`~wx.ListCtrl.EnableBellOnNoMatch`                                         Enable or disable a beep if there is no match for the currently entered text when searching for the item from keyboard.
:meth:`~wx.ListCtrl.EnsureVisible`                                               Ensures this item is visible.
:meth:`~wx.ListCtrl.FindItem`                                                    Find an item whose label matches this string, starting from start or the beginning if start is  ``-1`` .
:meth:`~wx.ListCtrl.Focus`                                                       Focus and show the given item.
:meth:`~wx.ListCtrl.GetColumn`                                                   Gets information about this column. See SetItem() for more information.
:meth:`~wx.ListCtrl.GetColumnCount`                                              Returns the number of columns.
:meth:`~wx.ListCtrl.GetColumnIndexFromOrder`                                     Gets the column index from its position in visual order.
:meth:`~wx.ListCtrl.GetColumnOrder`                                              Gets the column visual order position.
:meth:`~wx.ListCtrl.GetColumnWidth`                                              Gets the column width (report view only).
:meth:`~wx.ListCtrl.GetColumnsOrder`                                             Returns the array containing the orders of all columns.
:meth:`~wx.ListCtrl.GetCountPerPage`                                             Gets the number of items that can fit vertically in the visible area of the list control (list or report view) or the total number of items in the list control (icon or small icon view).
:meth:`~wx.ListCtrl.GetEditControl`                                              Returns the edit control being currently used to edit a label.
:meth:`~wx.ListCtrl.GetFirstSelected`                                            Returns the first selected item, or -1 when none is selected.
:meth:`~wx.ListCtrl.GetFocusedItem`                                              Gets the currently focused item or -1 if none is focused.
:meth:`~wx.ListCtrl.GetImageList`                                                Returns the specified image list.
:meth:`~wx.ListCtrl.GetItem`                                                     Gets information about the item. See SetItem() for more information.
:meth:`~wx.ListCtrl.GetItemBackgroundColour`                                     Returns the colour for this item.
:meth:`~wx.ListCtrl.GetItemCount`                                                Returns the number of items in the list control.
:meth:`~wx.ListCtrl.GetItemData`                                                 Gets the application-defined data associated with this item.
:meth:`~wx.ListCtrl.GetItemFont`                                                 Returns the item's font.
:meth:`~wx.ListCtrl.GetItemPosition`                                             Returns the position of the item, in icon or small icon view.
:meth:`~wx.ListCtrl.GetItemRect`                                                 Returns the rectangle representing the item's size and position, in physical coordinates.
:meth:`~wx.ListCtrl.GetItemSpacing`                                              Retrieves the spacing between icons in pixels: horizontal spacing is returned as  ``x``   component of the  :ref:`wx.Size`  object and the vertical spacing as its  ``y``   component.
:meth:`~wx.ListCtrl.GetItemState`                                                Gets the item state.
:meth:`~wx.ListCtrl.GetItemText`                                                 Gets the item text for this item.
:meth:`~wx.ListCtrl.GetItemTextColour`                                           Returns the colour for this item.
:meth:`~wx.ListCtrl.GetMainWindow`                                               
:meth:`~wx.ListCtrl.GetNextItem`                                                 Searches for an item with the given geometry or state, starting from `item`  but excluding the `item`  itself.
:meth:`~wx.ListCtrl.GetNextSelected`                                             Returns subsequent selected items, or -1 when no more are selected.
:meth:`~wx.ListCtrl.GetSelectedItemCount`                                        Returns the number of selected items in the list control.
:meth:`~wx.ListCtrl.GetSubItemRect`                                              Returns the rectangle representing the size and position, in physical coordinates, of the given subitem, i.e.
:meth:`~wx.ListCtrl.GetTextColour`                                               Gets the text colour of the list control.
:meth:`~wx.ListCtrl.GetTopItem`                                                  Gets the index of the topmost visible item when in list or report view.
:meth:`~wx.ListCtrl.GetViewRect`                                                 Returns the rectangle taken by all items in the control.
:meth:`~wx.ListCtrl.HasColumnOrderSupport`                                       
:meth:`~wx.ListCtrl.HitTest`                                                     Determines which item (if any) is at the specified point, giving details in `flags`.
:meth:`~wx.ListCtrl.HitTestSubItem`                                              Determines which item (if any) is at the specified point, giving details in flags.
:meth:`~wx.ListCtrl.InReportView`                                                Returns ``True`` if the control is currently using ``LC_REPORT``  style.
:meth:`~wx.ListCtrl.InsertColumn`                                                For report view mode (only), inserts a column.
:meth:`~wx.ListCtrl.InsertItem`                                                  Inserts an item, returning the index of the new item if successful, -1 otherwise.
:meth:`~wx.ListCtrl.IsSelected`                                                  Returns ``True`` if the item is selected.
:meth:`~wx.ListCtrl.IsVirtual`                                                   Returns ``True`` if the control is currently in virtual report view.
:meth:`~wx.ListCtrl.OnGetItemAttr`                                               This function may be overridden in the derived class for a control with  ``LC_VIRTUAL``   style.
:meth:`~wx.ListCtrl.OnGetItemColumnImage`                                        Override this function in the derived class for a control with  ``LC_VIRTUAL``   and   ``LC_REPORT``   styles in order to specify the image index for the given line and column.
:meth:`~wx.ListCtrl.OnGetItemImage`                                              This function must be overridden in the derived class for a control with  ``LC_VIRTUAL``   style having an "image list" (see  :meth:`~ListCtrl.SetImageList` ; if the control doesn't have an image list, it is not necessary to override it).
:meth:`~wx.ListCtrl.OnGetItemText`                                               This function **must**  be overridden in the derived class for a control with  ``LC_VIRTUAL``   style.
:meth:`~wx.ListCtrl.RefreshItem`                                                 Redraws the given `item`.
:meth:`~wx.ListCtrl.RefreshItems`                                                Redraws the items between `itemFrom`  and `itemTo`.
:meth:`~wx.ListCtrl.ScrollList`                                                  Scrolls the list control.
:meth:`~wx.ListCtrl.Select`                                                      Selects/deselects an item.
:meth:`~wx.ListCtrl.SetAlternateRowColour`                                       Set the alternative row background colour to a specific colour.
:meth:`~wx.ListCtrl.SetBackgroundColour`                                         Sets the background colour.
:meth:`~wx.ListCtrl.SetColumn`                                                   Sets information about this column.
:meth:`~wx.ListCtrl.SetColumnImage`                                              
:meth:`~wx.ListCtrl.SetColumnWidth`                                              Sets the column width.
:meth:`~wx.ListCtrl.SetColumnsOrder`                                             Changes the order in which the columns are shown.
:meth:`~wx.ListCtrl.SetImageList`                                                Sets the image list associated with the control.
:meth:`~wx.ListCtrl.SetItem`                                                     Sets the data of an item.
:meth:`~wx.ListCtrl.SetItemBackgroundColour`                                     Sets the background colour for this item.
:meth:`~wx.ListCtrl.SetItemColumnImage`                                          Sets the image associated with the item.
:meth:`~wx.ListCtrl.SetItemCount`                                                This method can only be used with virtual list controls.
:meth:`~wx.ListCtrl.SetItemData`                                                 Associates application-defined data with this item.
:meth:`~wx.ListCtrl.SetItemFont`                                                 Sets the item's font.
:meth:`~wx.ListCtrl.SetItemImage`                                                Sets the unselected and selected images associated with the item.
:meth:`~wx.ListCtrl.SetItemPosition`                                             Sets the position of the item, in icon or small icon view.
:meth:`~wx.ListCtrl.SetItemState`                                                Sets the item state.
:meth:`~wx.ListCtrl.SetItemText`                                                 Sets the item text for this item.
:meth:`~wx.ListCtrl.SetItemTextColour`                                           Sets the colour for this item.
:meth:`~wx.ListCtrl.SetSingleStyle`                                              Adds or removes a single window style.
:meth:`~wx.ListCtrl.SetTextColour`                                               Sets the text colour of the list control.
:meth:`~wx.ListCtrl.SetWindowStyleFlag`                                          Sets the whole window style, deleting all items.
:meth:`~wx.ListCtrl.SortItems`                                                   Call this function to sort the items in the list control.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ListCtrl.Column`                                                      See :meth:`~wx.ListCtrl.GetColumn` and :meth:`~wx.ListCtrl.SetColumn`
:attr:`~wx.ListCtrl.ColumnCount`                                                 See :meth:`~wx.ListCtrl.GetColumnCount`
:attr:`~wx.ListCtrl.ColumnsOrder`                                                See :meth:`~wx.ListCtrl.GetColumnsOrder` and :meth:`~wx.ListCtrl.SetColumnsOrder`
:attr:`~wx.ListCtrl.CountPerPage`                                                See :meth:`~wx.ListCtrl.GetCountPerPage`
:attr:`~wx.ListCtrl.EditControl`                                                 See :meth:`~wx.ListCtrl.GetEditControl`
:attr:`~wx.ListCtrl.FocusedItem`                                                 See :meth:`~wx.ListCtrl.GetFocusedItem`
:attr:`~wx.ListCtrl.Item`                                                        See :meth:`~wx.ListCtrl.GetItem` and :meth:`~wx.ListCtrl.SetItem`
:attr:`~wx.ListCtrl.ItemCount`                                                   See :meth:`~wx.ListCtrl.GetItemCount` and :meth:`~wx.ListCtrl.SetItemCount`
:attr:`~wx.ListCtrl.ItemPosition`                                                See :meth:`~wx.ListCtrl.GetItemPosition` and :meth:`~wx.ListCtrl.SetItemPosition`
:attr:`~wx.ListCtrl.ItemRect`                                                    See :meth:`~wx.ListCtrl.GetItemRect`
:attr:`~wx.ListCtrl.ItemSpacing`                                                 See :meth:`~wx.ListCtrl.GetItemSpacing`
:attr:`~wx.ListCtrl.MainWindow`                                                  See :meth:`~wx.ListCtrl.GetMainWindow`
:attr:`~wx.ListCtrl.SelectedItemCount`                                           See :meth:`~wx.ListCtrl.GetSelectedItemCount`
:attr:`~wx.ListCtrl.TextColour`                                                  See :meth:`~wx.ListCtrl.GetTextColour` and :meth:`~wx.ListCtrl.SetTextColour`
:attr:`~wx.ListCtrl.TopItem`                                                     See :meth:`~wx.ListCtrl.GetTopItem`
:attr:`~wx.ListCtrl.ViewRect`                                                    See :meth:`~wx.ListCtrl.GetViewRect`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.ListCtrl(Control)

   **Possible constructors**::

       ListCtrl()
       
       ListCtrl(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
                style=LC_ICON, validator=DefaultValidator, name=ListCtrlNameStr)
       
   
   A list control presents lists in a number of formats: list view,
   report view, icon view and small icon view.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      **~~~**

      
      **__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=LC_ICON, validator=DefaultValidator, name=ListCtrlNameStr)`
      
      Constructor, creating and showing a list control.                  
      
      
      
      
      :param `parent`: Parent window. Must not be ``None``.   
      :type `parent`: wx.Window
      :param `id`: Window identifier. The value ``wx.ID_ANY`` indicates a default value.   
      :type `id`: wx.WindowID
      :param `pos`: Window position. If :ref:`wx.DefaultPosition`  is specified then a default position is chosen.   
      :type `pos`: wx.Point
      :param `size`: Window size. If :ref:`wx.DefaultSize`  is specified then the window is sized appropriately.   
      :type `size`: wx.Size
      :param `style`: Window style. See :ref:`wx.ListCtrl`.   
      :type `style`: long
      :param `validator`: Window validator.   
      :type `validator`: wx.Validator
      :param `name`: Window name.  
      :type `name`: string
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
                        
      
      
      
      .. seealso:: :meth:`Create` , :ref:`wx.Validator`    
      
      
      
      
      
      
      
      **~~~**






   .. method:: Append(self, entry)

      Append an item to the list control.  The `entry` parameter should be a
      sequence with an item for each column



   .. method:: AppendColumn(self, heading, format=LIST_FORMAT_LEFT, width=-1)

      Adds a new column to the list control in report view mode.                  

      This is just a convenient wrapper for :meth:`InsertColumn`   which adds the new column after all the existing ones without having to specify its position explicitly. 

                


      :param `heading`: 
      :type `heading`: string
      :param `format`: 
      :type `format`: wx.ListColumnFormat
      :param `width`: 
      :type `width`: int




      :rtype: `long`







      .. versionadded:: 2.9.4 
     








   .. method:: Arrange(self, flag=LIST_ALIGN_DEFAULT)

      Arranges the items in icon or small icon view.                  

      This only has effect on Win32. `flag`  is one of:

      - ``wx.LIST_ALIGN_DEFAULT``: Default alignment. 
      - ``wx.LIST_ALIGN_LEFT``: Align to the left side of the control. 
      - ``wx.LIST_ALIGN_TOP``: Align to the top side of the control. 
      - ``wx.LIST_ALIGN_SNAP_TO_GRID``: Snap to grid.  


                 


      :param `flag`: 
      :type `flag`: int




      :rtype: `bool`








   .. method:: AssignImageList(self, imageList, which)

      Sets the image list associated with the control and takes ownership of it (i.e.                  

      the control will, unlike when using :meth:`SetImageList` , delete the list when destroyed). `which`  is one of  ``IMAGE_LIST_NORMAL`` ,   ``IMAGE_LIST_SMALL`` ,   ``IMAGE_LIST_STATE``   (the last is unimplemented). 

                


      :param `imageList`: 
      :type `imageList`: wx.ImageList
      :param `which`: 
      :type `which`: int






      .. seealso:: :meth:`SetImageList`     








   .. method:: ClearAll(self)

      Deletes all items and all columns.                  

                 



      .. note:: 

         This sends an event of type  ``wxEVT_LIST_DELETE_ALL_ITEMS``   under all platforms.    








   .. method:: ClearColumnImage(self, col)




   .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=LC_ICON, validator=DefaultValidator, name=ListCtrlNameStr)

      Creates the list control.                  

      See :ref:`wx.ListCtrl`  for further details.                  


      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `validator`: 
      :type `validator`: wx.Validator
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: DeleteAllColumns(self)

      Delete all columns in the list control.                  

                

      :rtype: `bool`







      :returns: 

         ``True`` if all columns were successfully deleted, ``False`` otherwise.   








   .. method:: DeleteAllItems(self)

      Deletes all items in the list control.                  

      This function does `not`  send the  ``wxEVT_LIST_DELETE_ITEM``   event because deleting many items from the control would be too slow then (unlike  :meth:`wx.ListCtrl.DeleteItem` ) but it does send the special  ``wxEVT_LIST_DELETE_ALL_ITEMS``   event if the control was not empty. If it was already empty, nothing is done and no event is sent. 

                

      :rtype: `bool`







      :returns: 

         ``True`` if the items were successfully deleted or if the control was already empty, ``False`` if an error occurred while deleting the items.   








   .. method:: DeleteColumn(self, col)

      Deletes a column.                  


      :param `col`: 
      :type `col`: int




      :rtype: `bool`








   .. method:: DeleteItem(self, item)

      Deletes the specified item.                  

      This function sends the  ``wxEVT_LIST_DELETE_ITEM``   event for the item being deleted. 

                


      :param `item`: 
      :type `item`: long




      :rtype: `bool`







      .. seealso:: :meth:`DeleteAllItems`     








   .. method:: EditLabel(self, item)

      Starts editing the label of the given item.                  

      This function generates a  ``EVT_LIST_BEGIN_LABEL_EDIT``   event which can be vetoed so that no text control will appear for in-place editing. 

      If the user changed the label (i.e. s/he does not press ``ESC`` or leave the text control without changes, a  ``EVT_LIST_END_LABEL_EDIT``   event will be sent which can be vetoed as well.                   


      :param `item`: 
      :type `item`: long




      :rtype: :ref:`wx.TextCtrl`








   .. method:: EnableAlternateRowColours(self, enable=True)

      Enable alternating row background colours (also called zebra striping).                  

      This method can only be called for the control in virtual report mode, i.e. having ``LC_REPORT``  and ``LC_VIRTUAL``  styles. 

      When enabling alternating colours, the appropriate colour for the even rows is chosen automatically depending on the default foreground and background colours which are used for the odd rows. 




      :param `enable`: If ``True``, enable alternating row background colours, i.e. different colours for the odd and even rows. If ``False``, disable this feature and use the same background colour for all rows.  
      :type `enable`: bool




                  



      .. versionadded:: 2.9.5 
    







      .. seealso:: :meth:`SetAlternateRowColour`     








   .. method:: EnableBellOnNoMatch(self, on=True)

      Enable or disable a beep if there is no match for the currently entered text when searching for the item from keyboard.                  

      The default is to not beep in this case except in wxMSW where the beep is always generated by the native control and cannot be disabled, i.e. calls to this function do nothing there. 

                


      :param `on`: 
      :type `on`: bool






      .. versionadded:: 2.9.5 
     








   .. method:: EnsureVisible(self, item)

      Ensures this item is visible.                  


      :param `item`: 
      :type `item`: long




      :rtype: `bool`








   .. method:: FindItem(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **FindItem** `(self, start, str, partial=False)`
      
      Find an item whose label matches this string, starting from start or the beginning if start is  ``-1`` .                   
      
      The string comparison is case insensitive. 
      
      If `partial`  is ``True`` then this method will look for items which begin with `str`. 
      
                      
      
      
      :param `start`: 
      :type `start`: long
      :param `str`: 
      :type `str`: string
      :param `partial`: 
      :type `partial`: bool
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      :returns: 
      
         The next matching item if any or  ``-1``   (wx``wx.NOT_FOUND``) otherwise.    
      
      
      
      
      
      
      
      **~~~**

      
      **FindItem** `(self, start, data)`
      
      Find an item whose data matches this data, starting from start or the beginning if 'start' is  ``-1`` .                   
      
      
      
      
      
      **~~~**

      
      **FindItem** `(self, start, pt, direction)`
      
      Find an item nearest this position in the specified direction, starting from `start`  or the beginning if `start`  is -1.                  
      
      
      
      
      
      **~~~**






   .. method:: Focus(self, idx)

      Focus and show the given item.



   .. method:: GetColumn(self, col)

      Gets information about this column. See SetItem() for more information. 

      :rtype: :ref:`wx.ListItem`








   .. method:: GetColumnCount(self)

      Returns the number of columns.                  

      :rtype: `int`








   .. method:: GetColumnIndexFromOrder(self, pos)

      Gets the column index from its position in visual order.                  

      After calling :meth:`SetColumnsOrder` , the index returned by this function corresponds to the value of the element number `pos`  in the array returned by :meth:`GetColumnsOrder` . 

      Please see :meth:`SetColumnsOrder`   documentation for an example and additional remarks about the columns ordering. 

                


      :param `pos`: 
      :type `pos`: int




      :rtype: `int`







      .. seealso:: :meth:`GetColumnOrder`     








   .. method:: GetColumnOrder(self, col)

      Gets the column visual order position.                  

      This function returns the index of the column which appears at the given visual position, e.g. calling it with `col`  equal to 0 returns the index of the first shown column. 

      Please see :meth:`SetColumnsOrder`   documentation for an example and additional remarks about the columns ordering. 

                


      :param `col`: 
      :type `col`: int




      :rtype: `int`







      .. seealso:: :meth:`GetColumnsOrder` , :meth:`GetColumnIndexFromOrder`     








   .. method:: GetColumnWidth(self, col)

      Gets the column width (report view only).                  


      :param `col`: 
      :type `col`: int




      :rtype: `int`








   .. method:: GetColumnsOrder(self)

      Returns the array containing the orders of all columns.                  

      On error, an empty array is returned. 

      Please see :meth:`SetColumnsOrder`   documentation for an example and additional remarks about the columns ordering. 

                

      :rtype: `list of integers`







      .. seealso:: :meth:`GetColumnOrder` , :meth:`GetColumnIndexFromOrder`     








   .. method:: GetCountPerPage(self)

      Gets the number of items that can fit vertically in the visible area of the list control (list or report view) or the total number of items in the list control (icon or small icon view).                  

      :rtype: `int`








   .. method:: GetEditControl(self)

      Returns the edit control being currently used to edit a label.                  

      Returns ``None`` if no label is being edited. 

                

      :rtype: :ref:`wx.TextCtrl`







      .. note:: 

         It is currently only implemented for wxMSW and the generic version, not for the native Mac OS X version.   








   .. method:: GetFirstSelected(self, *args)

      Returns the first selected item, or -1 when none is selected.



   .. method:: GetFocusedItem(self)

      Gets the currently focused item or -1 if none is focused.



   .. method:: GetImageList(self, which)

      Returns the specified image list.                  

      `which`  may be one of:

      - ``wx.IMAGE_LIST_NORMAL``: The normal (large icon) image list. 
      - ``wx.IMAGE_LIST_SMALL``: The small icon image list. 
      - ``wx.IMAGE_LIST_STATE``: The user-defined state image list (unimplemented).  


                 


      :param `which`: 
      :type `which`: int




      :rtype: :ref:`wx.ImageList`








   .. method:: GetItem(self, itemIdx, col=0)

      Gets information about the item. See SetItem() for more information. 

      :rtype: :ref:`wx.ListItem`








   .. method:: GetItemBackgroundColour(self, item)

      Returns the colour for this item.                  

      If the item has no specific colour, returns an invalid colour (and not the default background control of the control itself). 

                


      :param `item`: 
      :type `item`: long




      :rtype: :ref:`wx.Colour`







      .. seealso:: :meth:`GetItemTextColour`     








   .. method:: GetItemCount(self)

      Returns the number of items in the list control.                  

      :rtype: `int`








   .. method:: GetItemData(self, item)

      Gets the application-defined data associated with this item.                  


      :param `item`: 
      :type `item`: long




      :rtype: `long`








   .. method:: GetItemFont(self, item)

      Returns the item's font.                  


      :param `item`: 
      :type `item`: long




      :rtype: :ref:`wx.Font`








   .. method:: GetItemPosition(self, item)

      Returns the position of the item, in icon or small icon view. 

      :rtype: :ref:`wx.Point`








   .. method:: GetItemRect(self, item, code=LIST_RECT_BOUNDS)

                      Returns the rectangle representing the item's size and position, in physical coordinates.
                      code is one of wx.``wx.LIST_RECT_BOUNDS``, wx.``wx.LIST_RECT_ICON``, wx.``wx.LIST_RECT_LABEL``. 

      :rtype: :ref:`wx.Rect`








   .. method:: GetItemSpacing(self)

      Retrieves the spacing between icons in pixels: horizontal spacing is returned as  ``x``   component of the  :ref:`wx.Size`  object and the vertical spacing as its  ``y``   component.                   

      :rtype: :ref:`wx.Size`








   .. method:: GetItemState(self, item, stateMask)

      Gets the item state.                  

      For a list of state flags, see :meth:`SetItem` . The `stateMask`  indicates which state flags are of interest.                  


      :param `item`: 
      :type `item`: long
      :param `stateMask`: 
      :type `stateMask`: long




      :rtype: `int`








   .. method:: GetItemText(self, item, col=0)

      Gets the item text for this item.                  




      :param `item`: Item (zero-based) index.   
      :type `item`: long
      :param `col`: Item column (zero-based) index. Column 0 is the default. This parameter is new in wxWidgets 2.9.1.   
      :type `col`: int








      :rtype: `string`



                  





   .. method:: GetItemTextColour(self, item)

      Returns the colour for this item.                  

      If the item has no specific colour, returns an invalid colour (and not the default foreground control of the control itself as this wouldn't allow distinguishing between items having the same colour as the current control foreground and items with default colour which, hence, have always the same colour as the control).                  


      :param `item`: 
      :type `item`: long




      :rtype: :ref:`wx.Colour`








   .. method:: GetMainWindow(self)



      :rtype: :ref:`wx.Window`








   .. method:: GetNextItem(self, item, geometry=LIST_NEXT_ALL, state=LIST_STATE_DONTCARE)

      Searches for an item with the given geometry or state, starting from `item`  but excluding the `item`  itself.                  

      If `item`  is -1, the first item that matches the specified flags will be returned. Returns the first item with given state following `item`  or -1 if no such item found. This function may be used to find all selected items in the control like this: 

      ::

                  item = -1

                  while 1:
                      item = listctrl.GetNextItem(item,
                                                  wx.LIST_NEXT_ALL,
                                                  wx.LIST_STATE_SELECTED)
                      if item == -1:
                          break

                      # This item is selected - do whatever is needed with it
                      wx.LogMessage("Item %ld is selected"%item)



      `geometry`  can be one of:

      - ``wx.LIST_NEXT_ABOVE``: Searches for an item above the specified item. 
      - ``wx.LIST_NEXT_ALL``: Searches for subsequent item by index. 
      - ``wx.LIST_NEXT_BELOW``: Searches for an item below the specified item. 
      - ``wx.LIST_NEXT_LEFT``: Searches for an item to the left of the specified item. 
      - ``wx.LIST_NEXT_RIGHT``: Searches for an item to the right of the specified item. 




      `state`  can be a bitlist of the following:

      - ``wx.LIST_STATE_DONTCARE``: Don't care what the state is. 
      - ``wx.LIST_STATE_DROPHILITED``: The item indicates it is a drop target. 
      - ``wx.LIST_STATE_FOCUSED``: The item has the focus. 
      - ``wx.LIST_STATE_SELECTED``: The item is selected. 
      - ``wx.LIST_STATE_CUT``: The item is selected as part of a cut and paste operation.  


                 


      :param `item`: 
      :type `item`: long
      :param `geometry`: 
      :type `geometry`: int
      :param `state`: 
      :type `state`: int




      :rtype: `long`







      .. note:: 

         this parameter is only supported by wxMSW currently and ignored on other platforms.  








   .. method:: GetNextSelected(self, item)

      Returns subsequent selected items, or -1 when no more are selected.



   .. method:: GetSelectedItemCount(self)

      Returns the number of selected items in the list control.                  

      :rtype: `int`








   .. method:: GetSubItemRect(self, item, subItem, rect, code=LIST_RECT_BOUNDS)

      Returns the rectangle representing the size and position, in physical coordinates, of the given subitem, i.e.                  

      the part of the row `item`  in the column `subItem`. 

      This method is only meaningful when the :ref:`wx.ListCtrl`  is in the report mode. If `subItem`  parameter is equal to the special value  ``LIST_GETSUBITEMRECT_WHOLEITEM``   the return value is the same as for  :meth:`GetItemRect` . 

      `code`  can be one of  ``LIST_RECT_BOUNDS`` ,   ``LIST_RECT_ICON``   or   ``LIST_RECT_LABEL`` . 

                


      :param `item`: 
      :type `item`: long
      :param `subItem`: 
      :type `subItem`: long
      :param `rect`: 
      :type `rect`: wx.Rect
      :param `code`: 
      :type `code`: int




      :rtype: `bool`







      .. versionadded:: 2.7.0 
     








   .. method:: GetTextColour(self)

      Gets the text colour of the list control.                  

      :rtype: :ref:`wx.Colour`








   .. method:: GetTopItem(self)

      Gets the index of the topmost visible item when in list or report view.                  

      :rtype: `long`








   .. method:: GetViewRect(self)

      Returns the rectangle taken by all items in the control.                  

      In other words, if the controls client size were equal to the size of this rectangle, no scrollbars would be needed and no free space would be left. 

      Note that this function only works in the icon and small icon views, not in list or report views (this is a limitation of the native Win32 control).                  

      :rtype: :ref:`wx.Rect`








   .. method:: HasColumnOrderSupport(self)



      :rtype: `bool`








   .. method:: HitTest(self, point)

      Determines which item (if any) is at the specified point, giving details in `flags`.                  

      Returns index of the item or  ``NOT_FOUND``   if no item is at the specified point. 

      `flags`  will be a combination of the following flags:

      - ``wx.LIST_HITTEST_ABOVE``: Above the client area. 
      - ``wx.LIST_HITTEST_BELOW``: Below the client area. 
      - ``wx.LIST_HITTEST_NOWHERE``: In the client area but below the last item. 
      - ``wx.LIST_HITTEST_ONITEMICON``: On the bitmap associated with an item. 
      - ``wx.LIST_HITTEST_ONITEMLABEL``: On the label (string) associated with an item. 
      - ``wx.LIST_HITTEST_ONITEMRIGHT``: In the area to the right of an item. 
      - ``wx.LIST_HITTEST_ONITEMSTATEICON``: On the state icon for a tree view item that is in a user-defined state. 
      - ``wx.LIST_HITTEST_TOLEFT``: To the right of the client area. 
      - ``wx.LIST_HITTEST_TORIGHT``: To the left of the client area. 
      - ``wx.LIST_HITTEST_ONITEM``: Combination of  ``LIST_HITTEST_ONITEMICON`` ,   ``LIST_HITTEST_ONITEMLABEL`` ,   ``LIST_HITTEST_ONITEMSTATEICON`` . 




      If `ptrSubItem`  is not ``None`` and the :ref:`wx.ListCtrl`  is in the report mode the subitem (or column) number will also be provided. This feature is only available in version 2.7.0 or higher and is currently only implemented under wxMSW and requires at least comctl32.dll of version 4.70 on the host system or the value stored in `ptrSubItem`  will be always -1. To compile this feature into wxWidgets library you need to have access to commctrl.h of version 4.70 that is provided by Microsoft. 

      




   .. method:: HitTestSubItem(self, itTestSubItem(point)

      Determines which item (if any) is at the specified point, giving details in flags. 

      :rtype: `tuple`







      :returns: 

         ( `item`, `flags`, `subitem` ) 








   .. method:: InReportView(self)

      Returns ``True`` if the control is currently using ``LC_REPORT``  style.                  

      :rtype: `bool`








   .. method:: InsertColumn(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **InsertColumn** `(self, col, info)`
      
      For report view mode (only), inserts a column.                  
      
      For more details, see :meth:`SetItem` . Also see InsertColumn(long,  :ref:`String`&, int, int) overload for a usually more convenient alternative to this method and the description of how the item width is interpreted by this method.                  
      
      
      :param `col`: 
      :type `col`: long
      :param `info`: 
      :type `info`: wx.ListItem
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      **~~~**

      
      **InsertColumn** `(self, col, heading, format=LIST_FORMAT_LEFT, width=LIST_AUTOSIZE)`
      
      For report view mode (only), inserts a column.                  
      
      Insert a new column in the list control in report view mode at the given position specifying its most common attributes. 
      
      Notice that to set the image for the column you need to use Insert(long,  ListItem&) overload and specify ``LIST_MASK_IMAGE``  in the item mask. 
      
      
      
      
      :param `col`: The index where the column should be inserted. Valid indices are from 0 up to :meth:`GetColumnCount`   inclusive and the latter can be used to append the new column after the last existing one.   
      :type `col`: long
      :param `heading`: The string specifying the column heading.   
      :type `heading`: string
      :param `format`: The flags specifying the control heading text alignment.   
      :type `format`: int
      :param `width`: If positive, the width of the column in pixels. Otherwise it can be  ``LIST_AUTOSIZE``   to choose the default size for the column or   ``LIST_AUTOSIZE_USEHEADER``   to fit the column width to   `heading`  or to extend to fill all the remaining space for the last column. Notice that in case of  ``LIST_AUTOSIZE``   fixed width is used as there are no items in this column to use for determining its best size yet. If you want to fit the column to its contents, use  :meth:`SetColumnWidth`   after adding the items with values in this column.   
      :type `width`: int
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: `long`
      
      
      
                        
      
      
      
      :returns: 
      
         The index of the inserted column or -1 if adding it failed.   
      
      
      
      
      
      
      
      **~~~**






   .. method:: InsertItem(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **InsertItem** `(self, info)`
      
      Inserts an item, returning the index of the new item if successful, -1 otherwise.                  
      
      
      
      
      :param `info`: :ref:`wx.ListItem`  object   
      :type `info`: wx.ListItem
      
      
      
      
      
      
      :rtype: `long`
      
      
      
                        
      
      
      
      
      **~~~**

      
      **InsertItem** `(self, index, label)`
      
      Insert an string item.                  
      
      
      
      
      :param `index`: Index of the new item, supplied by the application   
      :type `index`: long
      :param `label`: String label  
      :type `label`: string
      
      
      
      
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      **~~~**

      
      **InsertItem** `(self, index, imageIndex)`
      
      Insert an image item.                  
      
      
      
      
      :param `index`: Index of the new item, supplied by the application   
      :type `index`: long
      :param `imageIndex`: Index into the image list associated with this control and view style  
      :type `imageIndex`: int
      
      
      
      
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      **~~~**

      
      **InsertItem** `(self, index, label, imageIndex)`
      
      Insert an image/string item.                  
      
      
      
      
      :param `index`: Index of the new item, supplied by the application   
      :type `index`: long
      :param `label`: String label   
      :type `label`: string
      :param `imageIndex`: Index into the image list associated with this control and view style  
      :type `imageIndex`: int
      
      
      
      
      
      
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      **~~~**






   .. method:: IsSelected(self, idx)

      Returns ``True`` if the item is selected.



   .. method:: IsVirtual(self)

      Returns ``True`` if the control is currently in virtual report view.                  

      :rtype: `bool`








   .. method:: OnGetItemAttr(self, item)

      This function may be overridden in the derived class for a control with  ``LC_VIRTUAL``   style.                   

      It should return the attribute for the specified  ``item``   or ``None`` to use the default appearance parameters. 

      :ref:`wx.ListCtrl`  will not delete the pointer or keep a reference of it. You can return the same :ref:`wx.ListItemAttr`  pointer for every :meth:`OnGetItemAttr`   call. 

      The base class version always returns ``None``. 

                


      :param `item`: 
      :type `item`: long




      :rtype: :ref:`wx.ListItemAttr`







      .. seealso:: :meth:`OnGetItemImage` , :meth:`OnGetItemColumnImage` , :meth:`OnGetItemText` , :meth:`OnGetItemColumnAttr`     








   .. method:: OnGetItemColumnImage(self, item, column)

      Override this function in the derived class for a control with  ``LC_VIRTUAL``   and   ``LC_REPORT``   styles in order to specify the image index for the given line and column.                   

      The base class version always calls :meth:`OnGetItemImage`   for the first column, else it returns -1. 

                


      :param `item`: 
      :type `item`: long
      :param `column`: 
      :type `column`: long




      :rtype: `int`







      .. seealso:: :meth:`OnGetItemText` , :meth:`OnGetItemImage` , :meth:`OnGetItemAttr` , :meth:`OnGetItemColumnAttr`     








   .. method:: OnGetItemImage(self, item)

      This function must be overridden in the derived class for a control with  ``LC_VIRTUAL``   style having an "image list" (see  :meth:`SetImageList` ; if the control doesn't have an image list, it is not necessary to override it).                  

      It should return the index of the items image in the controls image list or -1 for no image. 

      In a control with  ``LC_REPORT``   style,  :meth:`OnGetItemImage`   only gets called for the first column of each line. 

      The base class version always returns -1. 

                


      :param `item`: 
      :type `item`: long




      :rtype: `int`







      .. seealso:: :meth:`OnGetItemText` , :meth:`OnGetItemColumnImage` , :meth:`OnGetItemAttr`     








   .. method:: OnGetItemText(self, item, column)

      This function **must**  be overridden in the derived class for a control with  ``LC_VIRTUAL``   style.                   

      It should return the string containing the text of the given `column`  for the specified  ``item`` . 

                


      :param `item`: 
      :type `item`: long
      :param `column`: 
      :type `column`: long




      :rtype: `string`







      .. seealso:: :meth:`SetItemCount` , :meth:`OnGetItemImage` , :meth:`OnGetItemColumnImage` , :meth:`OnGetItemAttr`     








   .. method:: RefreshItem(self, item)

      Redraws the given `item`.                  

      This is only useful for the virtual list controls as without calling this function the displayed value of the item doesn't change even when the underlying data does change. 

                


      :param `item`: 
      :type `item`: long






      .. seealso:: :meth:`RefreshItems`     








   .. method:: RefreshItems(self, itemFrom, itemTo)

      Redraws the items between `itemFrom`  and `itemTo`.                  

      The starting item must be less than or equal to the ending one. 

      Just as :meth:`RefreshItem`   this is only useful for virtual list controls.                  


      :param `itemFrom`: 
      :type `itemFrom`: long
      :param `itemTo`: 
      :type `itemTo`: long







   .. method:: ScrollList(self, dx, dy)

      Scrolls the list control.                  

      If in icon, small icon or report view mode, `dx`  specifies the number of pixels to scroll. If in list view mode, `dx`  specifies the number of columns to scroll. `dy`  always specifies the number of pixels to scroll vertically. 

                


      :param `dx`: 
      :type `dx`: int
      :param `dy`: 
      :type `dy`: int




      :rtype: `bool`







      .. note:: 

         This method is currently only implemented in the Windows version.   








   .. method:: Select(self, idx, on=1)

      Selects/deselects an item.



   .. method:: SetAlternateRowColour(self, colour)

      Set the alternative row background colour to a specific colour.                  

      It is recommended to call :meth:`EnableAlternateRowColours`   instead of using these methods as native implementations of this control might support alternating row colours but not setting the exact colour to be used for them. 

      As :meth:`EnableAlternateRowColours` , this method can only be used with controls having ``LC_REPORT``  and ``LC_VIRTUAL``  styles. 




      :param `colour`: A valid alternative row background colour to enable alternating rows or invalid colour to disable them and use the same colour for all rows.  
      :type `colour`: wx.Colour




                  



      .. versionadded:: 2.9.5 
     








   .. method:: SetBackgroundColour(self, col)

      Sets the background colour.                  

      Note that the :meth:`wx.Window.GetBackgroundColour`   function of :ref:`wx.Window`  base class can be used to retrieve the current background colour.                  


      :param `col`: 
      :type `col`: wx.Colour




      :rtype: `bool`








   .. method:: SetColumn(self, col, item)

      Sets information about this column.                  

      See :meth:`SetItem`   for more information.                  


      :param `col`: 
      :type `col`: int
      :param `item`: 
      :type `item`: wx.ListItem




      :rtype: `bool`








   .. method:: SetColumnImage(self, col, image)




   .. method:: SetColumnWidth(self, col, width)

      Sets the column width.                  

      `width`  can be a width in pixels or  ``LIST_AUTOSIZE``   (-1) or   ``LIST_AUTOSIZE_USEHEADER``   (-2). 

       ``LIST_AUTOSIZE``   will resize the column to the length of its longest item. 

       ``LIST_AUTOSIZE_USEHEADER``   will resize the column to the length of the header (Win32) or 80 pixels (other platforms). 

      In small or normal icon view, `col`  must be -1, and the column width is set for all columns.                  


      :param `col`: 
      :type `col`: int
      :param `width`: 
      :type `width`: int




      :rtype: `bool`








   .. method:: SetColumnsOrder(self, orders)

      Changes the order in which the columns are shown.                  

      By default, the columns of a list control appear on the screen in order of their indices, i.e. the column 0 appears first, the column 1 next and so on. However by using this function it is possible to arbitrarily reorder the columns visual order and the user can also rearrange the columns interactively by dragging them. In this case, the index of the column is not the same as its order and the functions :meth:`GetColumnOrder`   and :meth:`GetColumnIndexFromOrder`   should be used to translate between them. Notice that all the other functions still work with the column indices, i.e. the visual positioning of the columns on screen doesn't affect the code setting or getting their values for example. 

      The `orders`  array must have the same number elements as the number of columns and contain each position exactly once. Its n-th element contains the index of the column to be shown in n-th position, so for a control with three columns passing an array with elements 2, 0 and 1 results in the third column being displayed first, the first one next and the second one last. 

      Example of using it: ::

                      listCtrl = wx.ListCtrl(parent, style=wx.LC_REPORT)

                      for i in range(3):
                          listCtrl.InsertColumn(i, "Column %d"%i)

                      order = [2, 0, 1]
                      listCtrl.SetColumnsOrder(order)

                      # now listCtrl.GetColumnsOrder() will return order and
                      # listCtrl.GetColumnIndexFromOrder(n) will return order[n] and
                      # listCtrl.GetColumnOrder() will return 1, 2 and 0 for the column 0,
                      # 1 and 2 respectively



      Please notice that this function makes sense for report view only and currently is only implemented in wxMSW port. To avoid explicit tests for  ``WXMSW``  in your code, please use   ``HAS_LISTCTRL_COLUMN_ORDER``   as this will allow it to start working under the other platforms when support for the column reordering is added there. 

                


      :param `orders`: 
      :type `orders`: list of integers




      :rtype: `bool`







      .. seealso:: :meth:`GetColumnsOrder`     








   .. method:: SetImageList(self, imageList, which)

      Sets the image list associated with the control.                  

      `which`  is one of  ``IMAGE_LIST_NORMAL`` ,   ``IMAGE_LIST_SMALL`` ,   ``IMAGE_LIST_STATE``   (the last is unimplemented). 

      This method does not take ownership of the image list, you have to delete it yourself. 

                


      :param `imageList`: 
      :type `imageList`: wx.ImageList
      :param `which`: 
      :type `which`: int






      .. seealso:: :meth:`AssignImageList`     








   .. method:: SetItem(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **SetItem** `(self, info)`
      
      Sets the data of an item.                  
      
      Using the :ref:`wx.ListItem`'s mask and state mask, you can change only selected attributes of a :ref:`wx.ListCtrl`  item.                  
      
      
      :param `info`: 
      :type `info`: wx.ListItem
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**

      
      **SetItem** `(self, index, column, label, imageId=-1)`
      
      Sets an item string field at a particular column.                  
      
      
      :param `index`: 
      :type `index`: long
      :param `column`: 
      :type `column`: int
      :param `label`: 
      :type `label`: string
      :param `imageId`: 
      :type `imageId`: int
      
      
      
      
      :rtype: `long`
      
      
      
      
      
      
      
      **~~~**






   .. method:: SetItemBackgroundColour(self, item, col)

      Sets the background colour for this item.                  

      This function only works in report view mode. The colour can be retrieved using :meth:`GetItemBackgroundColour` .                  


      :param `item`: 
      :type `item`: long
      :param `col`: 
      :type `col`: wx.Colour







   .. method:: SetItemColumnImage(self, item, column, image)

      Sets the image associated with the item.                  

      In report view, you can specify the column. The image is an index into the image list associated with the list control.                  


      :param `item`: 
      :type `item`: long
      :param `column`: 
      :type `column`: long
      :param `image`: 
      :type `image`: int




      :rtype: `bool`








   .. method:: SetItemCount(self, count)

      This method can only be used with virtual list controls.                  

      It is used to indicate to the control the number of items it contains. After calling it, the main program should be ready to handle calls to various item callbacks (such as :meth:`wx.ListCtrl.OnGetItemText` ) for all items in the range from 0 to `count`. 

      Notice that the control is not necessarily redrawn after this call as it may be undesirable if an item which is not visible on the screen anyhow was added to or removed from a control displaying many items, if you do need to refresh the display you can just call :meth:`Refresh`   manually.                  


      :param `count`: 
      :type `count`: long







   .. method:: SetItemData(self, item, data)

      Associates application-defined data with this item.                  

      Notice that this function cannot be used to associate pointers with the control items, use :meth:`SetItemPtrData`   instead.                  


      :param `item`: 
      :type `item`: long
      :param `data`: 
      :type `data`: long




      :rtype: `bool`








   .. method:: SetItemFont(self, item, font)

      Sets the item's font.                  


      :param `item`: 
      :type `item`: long
      :param `font`: 
      :type `font`: wx.Font







   .. method:: SetItemImage(self, item, image, selImage=-1)

      Sets the unselected and selected images associated with the item.                  

      The images are indices into the image list associated with the list control.                  


      :param `item`: 
      :type `item`: long
      :param `image`: 
      :type `image`: int
      :param `selImage`: 
      :type `selImage`: int




      :rtype: `bool`








   .. method:: SetItemPosition(self, item, pos)

      Sets the position of the item, in icon or small icon view.                  

      Windows only.                  


      :param `item`: 
      :type `item`: long
      :param `pos`: 
      :type `pos`: wx.Point




      :rtype: `bool`








   .. method:: SetItemState(self, item, state, stateMask)

      Sets the item state.                  

      The `stateMask`  is a combination of  ``LIST_STATE_XXX``   constants described in  :ref:`wx.ListItem`  documentation. For each of the bits specified in `stateMask`, the corresponding state is set or cleared depending on whether `state`  argument contains the same bit or not. 

      So to select an item you can use ::

                      listCtrl.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)

      while to deselect it you should use ::

                      listCtrl.SetItemState(item, 0, wx.LIST_STATE_SELECTED)



      Consider using :ref:`wx.ListView`  if possible to avoid dealing with this error-prone and confusing method.                  


      :param `item`: 
      :type `item`: long
      :param `state`: 
      :type `state`: long
      :param `stateMask`: 
      :type `stateMask`: long




      :rtype: `bool`








   .. method:: SetItemText(self, item, text)

      Sets the item text for this item.                  


      :param `item`: 
      :type `item`: long
      :param `text`: 
      :type `text`: string







   .. method:: SetItemTextColour(self, item, col)

      Sets the colour for this item.                  

      This function only works in report view. The colour can be retrieved using :meth:`GetItemTextColour` .                  


      :param `item`: 
      :type `item`: long
      :param `col`: 
      :type `col`: wx.Colour







   .. method:: SetSingleStyle(self, style, add=True)

      Adds or removes a single window style.                  


      :param `style`: 
      :type `style`: long
      :param `add`: 
      :type `add`: bool







   .. method:: SetTextColour(self, col)

      Sets the text colour of the list control.                  


      :param `col`: 
      :type `col`: wx.Colour







   .. method:: SetWindowStyleFlag(self, style)

      Sets the whole window style, deleting all items.                  


      :param `style`: 
      :type `style`: long







   .. method:: SortItems(self, fnSortCallBack)

      Call this function to sort the items in the list control.                  

      Sorting is done using the specified `fnSortCallBack`  function. This function must have the following prototype: ::

                  def ListCompareFunction(self, item1, item2):

                      pass



      It is called each time when the two items must be compared and should return 0 if the items are equal, negative value if the first item is less than the second one and positive value if the first one is greater than the second one (the same convention as used by  ``qsort(3)`` ). 

      The parameter `item1`  is the client data associated with the first item (NOT the index). The parameter `item2`  is the client data associated with the second item (NOT the index). The parameter `data`  is the value passed to :meth:`SortItems`   itself. 

      Notice that the control may only be sorted on client data associated with the items, so you must use SetItemData if you want to be able to sort the items in the control. 

      Please see the :ref:`List Control Sample <list control sample>`  for an example of using this function. 

      




   .. attribute:: Column

      See :meth:`~wx.ListCtrl.GetColumn` and :meth:`~wx.ListCtrl.SetColumn`


   .. attribute:: ColumnCount

      See :meth:`~wx.ListCtrl.GetColumnCount`


   .. attribute:: ColumnsOrder

      See :meth:`~wx.ListCtrl.GetColumnsOrder` and :meth:`~wx.ListCtrl.SetColumnsOrder`


   .. attribute:: CountPerPage

      See :meth:`~wx.ListCtrl.GetCountPerPage`


   .. attribute:: EditControl

      See :meth:`~wx.ListCtrl.GetEditControl`


   .. attribute:: FocusedItem

      See :meth:`~wx.ListCtrl.GetFocusedItem`


   .. attribute:: Item

      See :meth:`~wx.ListCtrl.GetItem` and :meth:`~wx.ListCtrl.SetItem`


   .. attribute:: ItemCount

      See :meth:`~wx.ListCtrl.GetItemCount` and :meth:`~wx.ListCtrl.SetItemCount`


   .. attribute:: ItemPosition

      See :meth:`~wx.ListCtrl.GetItemPosition` and :meth:`~wx.ListCtrl.SetItemPosition`


   .. attribute:: ItemRect

      See :meth:`~wx.ListCtrl.GetItemRect`


   .. attribute:: ItemSpacing

      See :meth:`~wx.ListCtrl.GetItemSpacing`


   .. attribute:: MainWindow

      See :meth:`~wx.ListCtrl.GetMainWindow`


   .. attribute:: SelectedItemCount

      See :meth:`~wx.ListCtrl.GetSelectedItemCount`


   .. attribute:: TextColour

      See :meth:`~wx.ListCtrl.GetTextColour` and :meth:`~wx.ListCtrl.SetTextColour`


   .. attribute:: TopItem

      See :meth:`~wx.ListCtrl.GetTopItem`


   .. attribute:: ViewRect

      See :meth:`~wx.ListCtrl.GetViewRect`