File: control.texi

package info (click to toggle)
gcl 2.6.14-19
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 60,804 kB
  • sloc: ansic: 177,407; lisp: 151,508; asm: 128,169; sh: 22,510; cpp: 11,923; tcl: 3,181; perl: 2,930; makefile: 2,360; sed: 334; yacc: 226; lex: 95; awk: 30; fortran: 24; csh: 23
file content (3424 lines) | stat: -rwxr-xr-x 142,604 bytes parent folder | download | duplicates (7)
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
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
@c  Copyright (c) 1994 William Schelter.

@c  Copyright (c) 1990 The Regents of the University of California.
@c  All rights reserved.
@c 
@c  Permission is hereby granted, without written agreement and without
@c  license or royalty fees, to use, copy, modify, and distribute this
@c  documentation for any purpose, provided that the above copyright
@c  notice and the following two paragraphs appear in all copies.
@c 
@c  IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
@c  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
@c  ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
@c  CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@c 
@c  THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
@c  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
@c  AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
@c  ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
@c  PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.


@node Control, , Widgets, Top
@chapter Control

@menu
* after::			
* bind::			
* destroy::			
* tk-dialog::			
* exit::			
* focus::			
* grab::			
* tk-listbox-single-select::	
* lower::			
* tk-menu-bar::			
* option::			
* options::			
* pack-old::			
* pack::			
* place::			
* raise::			
* selection::			
* send::			
* tk::				
* tkerror::			
* tkvars::			
* tkwait::			
* update::			
* winfo::			
* wm::				
@end menu

@node after, bind, Control, Control
@section after
@c @cartouche

after - Execute a command after a time delay
@unnumberedsubsec Synopsis
@b{after }@i{ms }@r{?}@i{arg1 arg2 arg3 ...}?
@c @end cartouche

@unnumberedsubsec Description

This command is used to delay execution of the program or to execute
a command in background after a delay.  The @i{ms} argument gives
a time in milliseconds.
If @i{ms}@r{ is the only argument to }@b{after}
then the command sleeps for @i{ms} milliseconds and returns.
While the command is sleeping the application does not respond to
X events and other events.

If additional arguments are
present after @i{ms}, then a Tcl command is formed by concatenating
all the additional arguments in the same fashion as the @b{concat}
command.  @b{After} returns immediately but arranges for the command
to be executed @i{ms} milliseconds later in background.
The command will be executed at global level (outside the context
of any Tcl procedure).
If an error occurs while executing the delayed command then the
@b{tkerror} mechanism is used to report the error.

The @b{after} command always returns an empty string.

@xref{tkerror}.

@unnumberedsubsec Keywords
delay, sleep, time
@node bind, destroy, after, Control
@section bind
@c @cartouche

bind \- Arrange for X events to invoke Tcl commands
@unnumberedsubsec Synopsis
@*@w{@b{bind}@i{ windowSpec}}@*
@*@w{@b{bind}@i{ windowSpec sequence}}@*
@*@w{@b{bind}@i{ windowSpec sequence command}}@*
@b{bind}@i{ windowSpec sequence }@b{+}@i{command}
@c @end cartouche

@unnumberedsubsec Description

If all three arguments are specified, @b{bind} will
arrange for @i{command} (a Tcl
command) to be executed whenever the sequence of events given
by @i{sequence}@r{ occurs in the window(s) identified by }@i{windowSpec}.
If @i{command} is prefixed with a ``+'', then it is appended to
any existing binding for @i{sequence}@r{;  otherwise }@i{command} replaces
the existing binding, if any.  If @i{command}
is an empty string then the current binding for @i{sequence}
is destroyed, leaving @i{sequence} unbound.  In all of the cases
where a @i{command}@r{ argument is provided, }@b{bind} returns
an empty string.

If @i{sequence}@r{ is specified without a }@i{command}, then the
command currently bound to @i{sequence} is returned, or
an empty string if there is no binding for @i{sequence}.  If
neither @i{sequence}@r{ nor }@i{command} is specified, then the
return value is a list whose elements are all the sequences
for which there exist bindings for @i{windowSpec}.

The @i{windowSpec} argument selects which window(s) the binding
applies to.
It may have one of three forms.
If @i{windowSpec} is the path name for a window, then the binding
applies to that particular window.
If @i{windowSpec} is the name of a class of widgets, then the
binding applies to all widgets in that class.
Lastly, @i{windowSpec}@r{ may have the value }@b{all}, in which case
the binding applies to all windows in the application.

The @i{sequence} argument specifies a sequence of one or more
event patterns, with optional white space between the patterns.  Each
event pattern may
take either of two forms.  In the simplest case it is a single
printing ASCII character, such as @b{a}@r{ or }@b{[}.  The character
may not be a space character or the character @b{<}.  This form of
pattern matches a @b{KeyPress} event for the particular
character.  The second form of pattern is longer but more general.
It has the following syntax:

@example
@b{<}@i{modifier-modifier-type-detail}@b{>}
@end example

The entire event pattern is surrounded by angle brackets.
Inside the angle brackets are zero or more modifiers, an event
type, and an extra piece of information (@i{detail}) identifying
a particular button or keysym.  Any of the fields may be omitted,
as long as at least one of @i{type}@r{ and }@i{detail} is present.
The fields must be separated by white space or dashes.


Modifiers may consist of any of the values in the following list:

@example
Control                  Any                            
Shift                    Double                         
Lock                     Triple                         
Button1, B1              Mod1, M1, Meta, M              
Button2, B2              Mod2, M2, Alt                  
Button3, B3              Mod3, M3                       
Button4, B4              Mod4, M4                       
Button5, B5              Mod5, M5                       
@end example

Where more than one value is listed, separated by commas, the values
are equivalent.   All of the modifiers except @b{Any},
@b{Double}@r{, and }@b{Triple} have
the obvious X meanings.  For example, @b{Button1} requires that
button 1 be depressed when the event occurs.  Under normal conditions
the button and modifier state at the time of the event must
match exactly those specified in the @b{bind} command.  If
no modifiers are specified, then events will match only if no modifiers
are present.  If the @b{Any} modifier is specified, then additional
modifiers may be present besides those specified explicitly.  For
example, if button 1 is pressed while the shift and control keys
are down, the specifier @b{<Any-Control-Button-1>} will match
the event, but the specifier @b{<Control-Button-1>} will not.


The @b{Double}@r{ and }@b{Triple} modifiers are a convenience
for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be
repeated 2 or 3 times, and also place a time and space requirement
on the sequence:  for a sequence of events to match a @b{Double}
or @b{Triple} pattern, all of the events must occur close together
in time and without substantial mouse motion in between.
For example, @b{<Double-Button-1>}
is equivalent to @b{<Button-1><Button-1>} with the extra
time and space requirement.


The @i{type} field may be any of the standard X event types, with a
few extra abbreviations.  Below is a list of all the valid types;
where two name appear together, they are synonyms.

@example
ButtonPress, Button      Expose             Leave              
ButtonRelease            FocusIn            Map                
Circulate                FocusOut           Property           
CirculateRequest         Gravity            Reparent           
Colormap                 Keymap             ResizeRequest      
Configure                KeyPress, Key      Unmap              
ConfigureRequest         KeyRelease         Visibility         
Destroy                  MapRequest         
Enter                    Motion             
@end example



The last part of a long event specification is @i{detail}.  In the
case of a @b{ButtonPress}@r{ or }@b{ButtonRelease} event, it is the
number of a button (1-5).  If a button number is given, then only an
event on that particular button will match;  if no button number is
given, then an event on any button will match.  Note:  giving a
specific button number is different than specifying a button modifier;
in the first case, it refers to a button being pressed or released,
while in the second it refers to some other button that is already
depressed when the matching event occurs.  If a button
number is given then @i{type} may be omitted:  if will default
to @b{ButtonPress}@r{.  For example, the specifier }@b{<1>}
is equivalent to @b{<ButtonPress-1>}.


If the event type is @b{KeyPress}@r{ or }@b{KeyRelease}, then
@i{detail} may be specified in the form of an X keysym.  Keysyms
are textual specifications for particular keys on the keyboard;
they include all the alphanumeric ASCII characters (e.g. ``a'' is
the keysym for the ASCII character ``a''), plus descriptions for
non-alphanumeric characters (``comma'' is the keysym for the comma
character), plus descriptions for all the non-ASCII keys on the
keyboard (``Shift_L'' is the keysm for the left shift key, and
``F1'' is the keysym for the F1 function key, if it exists).  The
complete list of keysyms is not presented here;  it should be
available in other X documentation.  If necessary, you can use the
@b{%K} notation described below to print out the keysym name for
an arbitrary key.  If a keysym @i{detail} is given, then the
@i{type}@r{ field may be omitted;  it will default to }@b{KeyPress}.
For example, @b{<Control-comma>} is equivalent to
@b{<Control-KeyPress-comma>}@r{.  If a keysym }@i{detail} is specified
then the @b{Shift} modifier need not be specified and will be
ignored if specified:  each keysym already implies a particular
state for the shift key.


The @i{command}@r{ argument to }@b{bind} is a Tcl command string,
which will be executed whenever the given event sequence occurs.
@i{Command} will be executed in the same interpreter that the
@b{bind}@r{ command was executed in.  If }@i{command} contains
any @b{%} characters, then the command string will not be
executed directly.  Instead, a new command string will be
generated by replacing each @b{%}, and the character following
it, with information from the current event.  The replacement
depends on the character following the @b{%}, as defined in the
list below.  Unless otherwise indicated, the
replacement string is the decimal value of the given field from
the current event.
Some of the substitutions are only valid for
certain types of events;  if they are used for other types of events
the value substituted is undefined.

@table @asis
@item @b{%%}
Replaced with a single percent.
@item @b{|%#|}
The number of the last client request processed by the server
(the @i{serial} field from the event).  Valid for all event
types.
@item @b{|%a|}
The @i{above} field from the event.
Valid only for @b{ConfigureNotify} events.
@item @b{|%b|}
The number of the button that was pressed or released.  Valid only
for @b{ButtonPress}@r{ and }@b{ButtonRelease} events.
@item @b{|%c|}
The @i{count}@r{ field from the event.  Valid only for }@b{Expose},
@b{GraphicsExpose}@r{, and }@b{MappingNotify} events.
@item @b{|%d|}
The @i{detail}@r{ field from the event.  The }@b{|%d|} is replaced by
a string identifying the detail.  For @b{EnterNotify},
@b{LeaveNotify}@r{, }@b{FocusIn}@r{, and }@b{FocusOut} events,
the string will be one of the following:

@example
NotifyAncestor            NotifyNonlinearVirtual          
NotifyDetailNone          NotifyPointer                   
NotifyInferior            NotifyPointerRoot               
NotifyNonlinear           NotifyVirtual                   
@end example

For @b{ConfigureRequest} events, the substituted string will be
one of the following:

@example
Above                     Opposite                  
Below                     TopIf                     
BottomIf                  
@end example

For events other than these, the substituted string is undefined.
.RE
@item @b{|%f|}
The @i{focus}@r{ field from the event (}@b{0}@r{ or }@b{1}).  Valid only
for @b{EnterNotify}@r{ and }@b{LeaveNotify} events.
@item @b{|%h|}
The @i{height}@r{ field from the event.  Valid only for }@b{Configure},
@b{ConfigureNotify}@r{, }@b{Expose}@r{, }@b{GraphicsExpose}, and
@b{ResizeRequest} events.
@item @b{|%k|}
The @i{keycode}@r{ field from the event.  Valid only for }@b{KeyPress}
and @b{KeyRelease} events.
@item @b{|%m|}
The @i{mode} field from the event.  The substituted string is one of
@b{NotifyNormal}@r{, }@b{NotifyGrab}@r{, }@b{NotifyUngrab}, or
@b{NotifyWhileGrabbed}@r{.  Valid only for }@b{EnterWindow},
@b{FocusIn}@r{, }@b{FocusOut}@r{, and }@b{LeaveWindow} events.
@item @b{|%o|}
The @i{override_redirect} field from the event.  Valid only for
@b{CreateNotify}@r{, }@b{MapNotify}@r{, }@b{ReparentNotify},
and @b{ConfigureNotify} events.
@item @b{|%p|}
The @i{place} field from the event, substituted as one of the
strings @b{PlaceOnTop}@r{ or }@b{PlaceOnBottom}.  Valid only
for @b{CirculateNotify}@r{ and }@b{CirculateRequest} events.
@item @b{|%s|}
The @i{state}@r{ field from the event.  For }@b{ButtonPress},
@b{ButtonRelease}@r{, }@b{EnterNotify}@r{, }@b{KeyPress}@r{, }@b{KeyRelease},
@b{LeaveNotify}@r{, and }@b{MotionNotify} events,
a decimal string
is substituted.  For @b{VisibilityNotify}, one of the strings
@b{VisibilityUnobscured}@r{, }@b{VisibilityPartiallyObscured},
and @b{VisibilityFullyObscured} is substituted.
@item @b{|%t|}
The @i{time} field from the event.  Valid only for events that
contain a @i{time} field.
@item @b{|%v|}
The @i{value_mask} field from the event.  Valid only for
@b{ConfigureRequest} events.
@item @b{|%w|}
The @i{width} field from the event.  Valid only for
@b{Configure}@r{, }@b{ConfigureRequest}@r{, }@b{Expose},
@b{GraphicsExpose}@r{, and }@b{ResizeRequest} events.
@item @b{|%x|}
The @i{x} field from the event.  Valid only for events containing
an @i{x} field.
@item @b{|%y|}
The @i{y} field from the event.  Valid only for events containing
a @i{y} field.
@item @b{%A}
Substitutes the ASCII character corresponding to the event, or
the empty string if the event doesn't correspond to an ASCII character
(e.g. the shift key was pressed).  @b{XLookupString} does all the
work of translating from the event to an ASCII character.
Valid only for @b{KeyPress}@r{ and }@b{KeyRelease} events.
@item @b{%B}
The @i{border_width} field from the event.  Valid only for
@b{ConfigureNotify}@r{ and }@b{CreateWindow} events.
@item @b{%D}
The @i{display} field from the event.  Valid for all event types.
@item @b{%E}
The @i{send_event} field from the event.  Valid for all event types.
@item @b{%K}
The keysym corresponding to the event, substituted as a textual
string.  Valid only for @b{KeyPress}@r{ and }@b{KeyRelease} events.
@item @b{%N}
The keysym corresponding to the event, substituted as
a decimal
number.  Valid only for @b{KeyPress}@r{ and }@b{KeyRelease} events.
@item @b{%R}
The @i{root} window identifier from the event.  Valid only for
events containing a @i{root} field.
@item @b{%S}
The @i{subwindow} window identifier from the event.  Valid only for
events containing a @i{subwindow} field.
@item @b{%T}
The @i{type} field from the event.  Valid for all event types.
@item @b{%W}
The path name of the window to which the event was reported (the
@i{window} field from the event).  Valid for all event types.
@item @b{%X}
The @i{x_root} field from the event.
If a virtual-root window manager is being used then the substituted
value is the corresponding x-coordinate in the virtual root.
Valid only for
@b{ButtonPress}@r{, }@b{ButtonRelease}@r{, }@b{KeyPress}@r{, }@b{KeyRelease},
and @b{MotionNotify} events.
@item @b{%Y}
The @i{y_root} field from the event.
If a virtual-root window manager is being used then the substituted
value is the corresponding y-coordinate in the virtual root.
Valid only for
@b{ButtonPress}@r{, }@b{ButtonRelease}@r{, }@b{KeyPress}@r{, }@b{KeyRelease},
and @b{MotionNotify} events.
@end table


If the replacement string
for a %-replacement contains characters that are interpreted
specially by the Tcl parser (such as backslashes or square
brackets or spaces) additional backslashes are added
during replacement so that the result after parsing is the original
replacement string.
For example, if @i{command} is

@example
insert %A
@end example
@noindent

and the character typed is an open square bracket, then the command
actually executed will be

@example
insert \e[
@end example

This will cause the @b{insert} to receive the original replacement
string (open square bracket) as its first argument.
If the extra backslash hadn't been added, Tcl would not have been
able to parse the command correctly.


At most one binding will trigger for any given X event.
If several bindings match the recent events, the most specific binding
is chosen and its command will be executed.
The following tests are applied, in order, to determine which of
several matching sequences is more specific:
(a) a binding whose @i{windowSpec} names a particular window is
more specific than a binding for a class,
which is more specific than a binding whose @i{windowSpec} is
@b{all};
(b) a longer sequence (in terms of number
of events matched) is more specific than a shorter sequence;
(c) an event pattern that specifies a specific button or key is more specific
than one that doesn't;  (e) an event pattern that requires a particular
modifier is more specific than one that doesn't require the modifier;
(e) an event pattern specifying the @b{Any} modifier is less specific
than one that doesn't.  If the matching sequences contain more than
one event, then tests (c)-(e) are applied in order from the most
recent event to the least recent event in the sequences.  If these
tests fail to determine a winner, then the most recently registered
sequence is the winner.


If an X event does not match any of the existing bindings, then the
event is ignored (an unbound event is not considered to be an error).


When a @i{sequence}@r{ specified in a }@b{bind} command contains
more than one event pattern, then its command is executed whenever
the recent events (leading up to and including the current event)
match the given sequence.  This means, for example, that if button 1 is
clicked repeatedly the sequence @b{<Double-ButtonPress-1>} will match
each button press but the first.
If extraneous events that would prevent a match occur in the middle
of an event sequence then the extraneous events are
ignored unless they are @b{KeyPress}@r{ or }@b{ButtonPress} events.
For example, @b{<Double-ButtonPress-1>} will match a sequence of
presses of button 1, even though there will be @b{ButtonRelease}
events (and possibly @b{MotionNotify} events) between the
@b{ButtonPress} events.
Furthermore, a @b{KeyPress} event may be preceded by any number
of other @b{KeyPress} events for modifier keys without the
modifier keys preventing a match.
For example, the event sequence @b{aB} will match a press of the
@b{a}@r{ key, a release of the }@b{a}@r{ key, a press of the }@b{Shift}
key, and a press of the @b{b}@r{ key:  the press of }@b{Shift} is
ignored because it is a modifier key.
Finally, if several @b{MotionNotify} events occur in a row, only
the last one is used for purposes of matching binding sequences.


If an error occurs in executing the command for a binding then the
@b{tkerror} mechanism is used to report the error.
The command will be executed at global level (outside the context
of any Tcl procedure).

@xref{tkerror}.

@unnumberedsubsec Keywords
form, manual
@node destroy, tk-dialog, bind, Control
@section destroy
@c @cartouche

destroy \- Destroy one or more windows
@unnumberedsubsec Synopsis
@b{destroy }@r{?}@i{window window ...}?
@c @end cartouche

@unnumberedsubsec Description

This command deletes the windows given by the
@i{window} arguments, plus all of their descendants.
If a @i{window} ``.'' is deleted then the entire application
will be destroyed.
The @i{window}s are destroyed in order, and if an error occurs
in destroying a window the command aborts without destroying the
remaining windows.

@unnumberedsubsec Keywords
application, destroy, window
@node tk-dialog, exit, destroy, Control
@section tk-dialog
@c @cartouche

tk-dialog \- Create modal dialog and wait for response
@unnumberedsubsec Synopsis
@b{tk-dialog }@i{window title text bitmap default string string ...}
@c @end cartouche

@unnumberedsubsec Description

This procedure is part of the Tk script library.
Its arguments describe a dialog box:

@table @asis
@item @i{window}
Name of top-level window to use for dialog.  Any existing window
by this name is destroyed.
@item @i{title}
Text to appear in the window manager's title bar for the dialog.
@item @i{text}
Message to appear in the top portion of the dialog box.
@item @i{bitmap}
If non-empty, specifies a bitmap to display in the top portion of
the dialog, to the left of the text.
If this is an empty string then no bitmap is displayed in the dialog.
@item @i{default}
If this is an integer greater than or equal to zero, then it gives
the index of the button that is to be the default button for the dialog
(0 for the leftmost button, and so on).
If less than zero or an empty string then there won't be any default
button.
@item @i{string}
There will be one button for each of these arguments.
Each @i{string} specifies text to display in a button,
in order from left to right.

After creating a dialog box, @b{tk-dialog} waits for the user to
select one of the buttons either by clicking on the button with the
mouse or by typing return to invoke the default button (if any).
Then it returns the index of the selected button:  0 for the leftmost
button, 1 for the button next to it, and so on.

While waiting for the user to respond, @b{tk-dialog} sets a local
grab.  This prevents the user from interacting with the application
in any way except to invoke the dialog box.

@end table
@unnumberedsubsec Keywords
bitmap, dialog, modal
@node exit, focus, tk-dialog, Control
@section exit
@c @cartouche

exit \- Exit the process
@unnumberedsubsec Synopsis
@b{exit }@r{?}@i{returnCode}?
@c @end cartouche

@unnumberedsubsec Description

Terminate the process, returning @i{returnCode} (an integer) to the
system as the exit status.
If @i{returnCode} isn't specified then it defaults
to 0.
This command replaces the Tcl command by the same name.
It is identical to Tcl's @b{exit} command except that
before exiting it destroys all the windows managed by
the process.
This allows various cleanup operations to be performed, such
as removing application names from the global registry of applications.

@unnumberedsubsec Keywords
exit, process
@node focus, grab, exit, Control
@section focus
@c @cartouche

focus \- Direct keyboard events to a particular window
@unnumberedsubsec Synopsis
@*@w{@b{focus}}@*
@*@w{@b{focus }@i{window}}@*
@b{focus }@i{option}@r{ ?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

The @b{focus} command is used to manage the Tk input focus.
At any given time, one window in an application is designated as
the focus window for that application;  any key press or key release
events directed to any window in the application will be redirected
instead to the focus window.  If there is no focus window for an
application then keyboard events are discarded.
Typically, windows that are prepared to deal with the focus
(e.g. entries and other widgets that display editable text) will
claim the focus when mouse button 1 is pressed in them.
When an application is created its main window is initially given
the focus.

The @b{focus} command can take any of the following forms:

@table @asis
@item @b{focus}
If invoked with no arguments, @b{focus} returns the path name of
the current focus window, or @b{none} if there is no focus window.
@item @b{focus }@i{window}
If invoked with a single argument consisting of a window's path
name, @b{focus} sets the input focus to that window.
The return value is an empty string.
@item @b{focus :default }@r{?}@i{window}?
If @i{window} is specified, it becomes the default focus window
(the window that receives the focus whenever the focus window is
deleted) and the command returns an empty string.
If @i{window} isn't specified, the command returns the path name
of the current default focus window, or @b{none} if there is no
default.
@i{Window}@r{ may be specified as }@b{none} to clear its existing
value.
The default window is initially @b{none}.
@item @b{focus :none}
Clears the focus window, so that keyboard input to this application
will be discarded.

@end table
@unnumberedsubsec "Focus Events"

Tk's model of the input focus is different than X's model, and the
focus window set with the @b{focus} command is not usually the
same as the X focus window.
Tk never explicitly changes the official X focus window.
It waits for the window manager to direct the X input focus to
and from the application's top-level windows, and it intercepts
@b{FocusIn}@r{ and }@b{FocusOut} events coming from the X
server to detect these changes.
All of the focus events received from X are discarded by Tk;  they
never reach the application.
Instead, Tk generates a different stream of @b{FocusIn} and
@b{FocusOut} for the application.
This means that @b{FocusIn} and
and @b{FocusOut} events seen by the application will not obey the
conventions described in the documentation for Xlib.

Tk applications receive two kinds of @b{FocusIn}@r{ and }@b{FocusOut}
events, which can be distinguished by their @i{detail} fields.
Events with a @i{detail}@r{ of }@b{NotifyAncestor} are directed
to the current focus window when it becomes active or inactive.
A window is the active focus whenever two conditions are
simultaneously true: (a) the window is the focus window for its
application, and (b) some top-level window in the application has
received the X focus.
When this happens Tk generates a @b{FocusIn} event for the focus
window with detail @b{NotifyAncestor}.
When a window loses the active focus (either because the window manager
removed the focus from the application or because the focus window changed
within the application) then it receives a @b{FocusOut} event
with detail @b{NotifyAncestor}.

The events described above are directed to the application's focus
window regardless of which top-level window within the application
has received the focus.
The second kind of focus event is provided for applications that
need to know which particular top-level window has the X focus.
Tk generates @b{FocusIn}@r{ and }@b{FocusOut} events with detail
@b{NotifyVirtual} for top-level windows whenever they receive or
lose the X focus.
These events are generated regardless of which window in the
application has the Tk input focus.
They do not imply that keystrokes will be directed to the window
that receives the event;  they simply indicate which top-level
window is active as far as the window manager is concerned.
If a top-level window is also the application's focus window,
then it will receive both @b{NotifyVirtual}@r{ and }@b{NotifyAncestor}
events when it receives or loses the X focus.

Tk does not generate the hierarchical chains of @b{FocusIn} and
@b{FocusOut} events described in the Xlib documentation (e.g.
a window can get a @b{FocusIn}@r{ or }@b{FocusOut} event without
all of its ancestors getting events too).
Furthermore, the @i{mode} field in focus events is always
@b{NotifyNormal} and the only values ever present in the
@i{detail}@r{ field are }@b{NotifyAncestor}@r{ and }@b{NotifyVirtual}.

@unnumberedsubsec Keywords
events, focus, keyboard, top-level, window manager
@node grab, tk-listbox-single-select, focus, Control
@section grab
@c @cartouche

grab \- Confine pointer and keyboard events to a window sub-tree
@unnumberedsubsec Synopsis
@*@w{@b{grab }@r{?}@b{:global}@r{? }@i{window}}@*
@b{grab }@i{option }@r{?arg arg }...?
@c @end cartouche

@unnumberedsubsec Description

This command implements simple pointer and keyboard grabs for Tk.
Tk's grabs are different than the grabs
described in the Xlib documentation.
When a grab is set for a particular window, Tk restricts all pointer
events to the grab window and its descendants in Tk's window hierarchy.
Whenever the pointer is within the grab window's subtree, the pointer
will behave exactly the same as if there had been no grab at all
and all events will be reported in the normal fashion.
When the pointer is outside @i{window}'s tree, button presses and
releases and
mouse motion events are reported to @i{window}, and window entry
and window exit events are ignored.
The grab subtree ``owns'' the pointer:
windows outside the grab subtree will be visible on the screen
but they will be insensitive until the grab is released.
The tree of windows underneath the grab window can include top-level
windows, in which case all of those top-level windows
and their descendants will continue to receive mouse events
during the grab.

Two forms of grabs are possible:  local and global.
A local grab affects only the grabbing application:  events will
be reported to other applications as if the grab had never occurred.
Grabs are local by default.
A global grab locks out all applications on the screen,
so that only the given subtree of the grabbing application will be
sensitive to pointer events (mouse button presses, mouse button releases,
pointer motions, window entries, and window exits).
During global grabs the window manager will not receive pointer
events either.

During local grabs, keyboard events (key presses and key releases)
are delivered as usual:  the window
manager controls which application receives keyboard events, and
if they are sent to any window in the grabbing application then they are
redirected to the focus window.
During a global grab Tk grabs the keyboard so that all keyboard events
are always sent to the grabbing application.
The @b{focus} command is still used to determine which window in the
application receives the keyboard events.
The keyboard grab is released when the grab is released.

Grabs apply to particular displays.  If an application has windows
on multiple displays then it can establish a separate grab on each
display.
The grab on a particular display affects only the windows on
that display.
It is possible for different applications on a single display to have
simultaneous local grabs, but only one application can have a global
grab on a given display at once.

The @b{grab} command can take any of the following forms:

@table @asis
@item @b{grab }@r{?}@b{:global}@r{? }@i{window}
Same as @b{grab :set}, described below.
@item @b{grab :current }@r{?}@i{window}?
If @i{window} is specified, returns the name of the current grab
window in this application for @i{window}'s display, or an empty
string if there is no such window.
If @i{window} is omitted, the command returns a list whose elements
are all of the windows grabbed by this application for all displays,
or an empty string if the application has no grabs.
@item @b{grab :release }@i{window}
Releases the grab on @i{window} if there is one, otherwise does
nothing.  Returns an empty string.
@item @b{grab :set }@r{?}@b{:global}@r{? }@i{window}
Sets a grab on @i{window}@r{.  If }@b{:global} is specified then the
grab is global, otherwise it is local.
If a grab was already in effect for this application on
@i{window}'s display then it is automatically released.
If there is already a grab on @i{window} and it has the same
global/local form as the requested grab, then the command
does nothing.  Returns an empty string.
@item @b{grab :status }@i{window}
Returns @b{none}@r{ if no grab is currently set on }@i{window},
@b{local}@r{ if a local grab is set on }@i{window}, and
@b{global} if a global grab is set.

@end table
@unnumberedsubsec Bugs

It took an incredibly complex and gross implementation to produce
the simple grab effect described above.
Given the current implementation, it isn't safe for applications
to use the Xlib grab facilities at all except through the Tk grab
procedures.
If applications try to manipulate X's grab mechanisms directly,
things will probably break.

If a single process is managing several different Tk applications,
only one of those applications can have a local grab for a given
display at any given time.  If the applications are in different
processes, this restriction doesn't exist.

@unnumberedsubsec Keywords
grab, keyboard events, pointer events, window
@node tk-listbox-single-select, lower, grab, Control
@section tk-listbox-single-select
@c @cartouche

tk-listbox-single-select \- Allow only one selected element in listbox(es)
@unnumberedsubsec Synopsis
@b{tk-listbox-single-select }@i{arg }@r{?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

This command is a Tcl procedure provided as part of the Tk script library.
It takes as arguments the path names of one or more listbox widgets,
or the value @b{Listbox}.
For each named widget, @b{tk-listbox-single-select} modifies the
bindings of the widget so that only a single element may be selected
at a time (the normal configuration allows multiple elements to be
selected).
If the keyword @b{Listbox}@r{ is among the }@i{window} arguments,
then the class bindings for listboxes are changed so that all
listboxes have the one-selection-at-a-time behavior.

@unnumberedsubsec Keywords
listbox, selection
@node lower, tk-menu-bar, tk-listbox-single-select, Control
@section lower
@c @cartouche

lower \- Change a window's position in the stacking order
@unnumberedsubsec Synopsis
@b{lower }@i{window }@r{?}@i{belowThis}?
@c @end cartouche

@unnumberedsubsec Description

If the @i{belowThis} argument is omitted then the command lowers
@i{window} so that it is below all of its siblings in the stacking
order (it will be obscured by any siblings that overlap it and
will not obscure any siblings).
If @i{belowThis} is specified then it must be the path name of
a window that is either a sibling of @i{window} or the descendant
of a sibling of @i{window}.
In this case the @b{lower} command will insert
@i{window}@r{ into the stacking order just below }@i{belowThis}
(or the ancestor of @i{belowThis}@r{ that is a sibling of }@i{window});
this could end up either raising or lowering @i{window}.

@unnumberedsubsec Keywords
lower, obscure, stacking order
@node tk-menu-bar, option, lower, Control
@section tk-menu-bar
@c @cartouche

tk-menu-bar, tk_bindForTraversal \- Support for menu bars
@unnumberedsubsec Synopsis
@b{tk-menu-bar }@i{frame }@r{?}@i{menu menu ...}?
@sp 1
@b{tk_bindForTraversal }@i{arg arg ... }
@c @end cartouche

@unnumberedsubsec Description

These two commands are Tcl procedures in the Tk script library.
They provide support for menu bars.
A menu bar is a frame that contains a collection of menu buttons that
work together, so that the user can scan from one menu to another with
the mouse: if the mouse button is pressed over one menubutton (causing it
to post its menu) and the mouse is moved over another menubutton
in the same menu bar without releasing the mouse button, then the
menu of the first menubutton is unposted and the menu of the
new menubutton is posted instead.
Menus in a menu bar can also be accessed using keyboard traversal (i.e.
by typing keystrokes instead of using the mouse).
In order for an application to use these procedures, it must do three
things, which are described in the paragraphs below.

First, each application must call @b{tk-menu-bar} to provide information
about the menubar.
The @i{frame} argument gives the path name of the frame that contains
all of the menu buttons, and the @i{menu} arguments give path names
for all of the menu buttons associated with the menu bar.
Normally @i{frame}@r{ is the parent of each of the }@i{menu}'s.
This need not be the case, but @i{frame} must be an ancestor of
each of the @i{menu}'s in order for grabs to work correctly when
the mouse is used to pull down menus.
The order of the @i{menu} arguments determines the traversal order
for the menu buttons.
If @b{tk-menu-bar}@r{ is called without any }@i{menu} arguments, it
returns a list containing the current menu buttons for @i{frame},
or an empty string if @i{frame} isn't currently set up as a menu bar.
If @b{tk-menu-bar}@r{ is called with a single }@i{menu} argument
consisting of an empty string, any menubar information for @i{frame}
is removed;  from now on the menu buttons will function independently
without keyboard traversal.
Only one menu bar may be defined at a time within each top-level window.

The second thing an application must do is to identify the traversal
characters for menu buttons and menu entries.
This is done by underlining those characters using the
@b{:underline} options for the widgets.
The menu traversal system uses this information to traverse the
menus under keyboard control (see below).

The third thing that an application must do
is to make sure that the input focus is always in a window that
has been configured to support menu traversal.
If the input focus is @b{none} then input characters will
be discarded and no menu traversal will be possible.
If you have no other place to set the focus, set it to the menubar
widget:  @b{tk-menu-bar}@r{ creates bindings for its }@i{frame} argument to
support menu traversal.

The Tk startup scripts configure all the Tk widget classes with
bindings to support menu traversal, so menu traversal will be possible
regardless of which widget has the focus.
If your application defines new classes of widgets that support the
input focus, then you should call @b{tk_bindForTraversal} for
each of these classes.
@b{Tk_bindForTraversal} takes any number of arguments, each of
which is a widget path name or widget class name.
It sets up bindings for all the named widgets and
classes so that the menu traversal system will be invoked when
appropriate keystrokes are typed in those widgets or classes.

@unnumberedsubsec "Menu Traversal Bindings"

Once an application has made the three arrangements described
above, menu traversal will be available.
At any given time, the only menus available for traversal
are those associated with the top-level window containing the
input focus.
Menu traversal is initiated by one of the following actions:
@itemize @asis{}
@item
[1]
If <F10> is typed, then the first menu button in the list for the
top-level window is posted and the first entry within that
menu is selected.
@item
[2]
If <Alt-@i{key}@r{> is pressed, then the menu button that has }@i{key}
as its underlined character is posted
and the first entry within that menu is selected.
The comparison between @i{key} and the underlined characters
ignores case differences.
If no menu button matches @i{key} then the keystroke has no
effect.
@item
[3]
Clicking mouse button 1 on a menu button posts that menu and selects
its first entry.
@end itemize


Once a menu has been posted, the input focus is switched to that
menu and the following actions are possible:
@itemize @asis{}
@item
[1]
Typing <ESC> or clicking mouse button 1 outside the menu button or
its menu will abort the menu traversal.
@item
[2]
If <Alt-@i{key}> is pressed, then the entry in the posted menu
whose underlined character is @i{key} is invoked.
This causes the menu to be unposted, the entry's action to be
taken, and the menu traversal to end.
The comparison between @i{key} and underlined characters ignores
case differences.
If no menu entry matches @i{key} then the keystroke is ignored.
@item
[3]
The arrow keys may be used to move among entries and menus.
The left and right arrow keys move circularly among the available
menus and the up and down arrow keys move circularly among the
entries in the current menu.
@item
[4]
If <Return> is pressed, the selected entry in the posted menu is
invoked, which causes the menu to be unposted, the entry's action
to be taken, and the menu traversal to end.
@end itemize

When a menu traversal completes, the input focus reverts to the
window that contained it when the traversal started.

@unnumberedsubsec Keywords
keyboard traversal, menu, menu bar, post
@node option, options, tk-menu-bar, Control
@section option
@c @cartouche

option \- Add/retrieve window options to/from the option database
@unnumberedsubsec Synopsis
@b{option :add }@i{pattern value }@r{?}@i{priority}?
@sp 1
@b{option :clear}
@sp 1
@b{option :get }@i{window name class}
@sp 1
@b{option :readfile }@i{fileName }@r{?}@i{priority}?
@c @end cartouche

@unnumberedsubsec Description

The @b{option} command allows you to add entries to the Tk option
database or to retrieve options from the database.  The @b{add}
form of the command adds a new option to the database.
@i{Pattern} contains
the option being specified, and consists of names and/or classes
separated by asterisks or dots, in the usual X format.  @i{Value}
contains a text string to associate with @i{pattern};  this is the
value that will be returned in calls to @b{Tk_GetOption} or by
invocations of the @b{option :get}@r{ command.  If }@i{priority}
is specified, it indicates the priority level for this option (see
below for legal values);  it defaults to @b{interactive}.
This command always returns an empty string.

The @b{option :clear} command clears the option database.  Default
options (in the
@b{RESOURCE_MANAGER}@r{ property or the }@b{.Xdefaults}
file) will be reloaded automatically the next time an
option is added to the database or removed from it.  This command
always returns an empty string.

The @b{option :get} command returns the value of the option
specified for @i{window}
under @i{name}@r{ and }@i{class}.  If several entries in the option
database match @i{window}@r{, }@i{name}@r{, and }@i{class}, then
the command returns whichever was created with highest
@i{priority} level.  If there are several matching
entries at the same priority level, then it returns whichever entry
was most recently entered into the option database.  If there are
no matching entries, then the empty string is returned.

The @b{readfile}@r{ form of the command reads }@i{fileName},
which should have the standard format for an
X resource database such as @b{.Xdefaults}, and adds all the
options specified in that file to the option database.  If @i{priority}
is specified, it indicates the priority level at which to enter the
options;  @i{priority}@r{ defaults to }@b{interactive}.

The @i{priority}@r{ arguments to the }@b{option} command are
normally specified symbolically using one of the following values:

@table @asis
@item @b{widgetDefault}
Level 20.  Used for default values hard-coded into widgets.
@item @b{startupFile}
Level 40.  Used for options specified in application-specific
startup files.
@item @b{userDefault}
Level 60.  Used for options specified in user-specific defaults
files, such as @b{.Xdefaults}, resource databases loaded into
the X server, or user-specific startup files.
@item @b{interactive}
Level 80.  Used for options specified interactively after the application
starts running.  If @i{priority} isn't specified, it defaults to
this level.
@end table


Any of the above keywords may be abbreviated.  In addition, priorities
may be specified numerically using integers between 0 and 100,
inclusive.  The numeric form is probably a bad idea except for new priority
levels other than the ones given above.

@unnumberedsubsec Keywords
database, option, priority, retrieve
@node options, pack-old, option, Control
@section options
@c @cartouche

options \- Standard options supported by widgets
@c @end cartouche

@unnumberedsubsec Description
This manual entry describes the common configuration options supported
by widgets in the Tk toolkit.  Every widget does not necessarily support
every option (see the manual entries for individual widgets for a list
of the standard options supported by that widget), but if a widget does
support an option with one of the names listed below, then the option
has exactly the effect described below.

In the descriptions below,
``Name'' refers to the option's name in the option database (e.g.
in .Xdefaults files).  ``Class'' refers to the option's class value
in the option database.  ``Command-Line Switch'' refers to the
switch used in widget-creation and @b{configure} widget commands to
set this value.  For example, if an option's command-line switch is
@b{:foreground}@r{ and there exists a widget }@b{.a.b.c}, then the
command

@example
@*@w{(.a.b.c  :configure  :foreground "black")}
@end example
@noindent

may be used to specify the value @b{black} for the option in the
the widget @b{.a.b.c}.  Command-line switches may be abbreviated,
as long as the abbreviation is unambiguous.


@table @asis
@item @code{@b{:activebackground}}
@flushright
Name=@code{"@b{activeBackground}@r{"} Class=@code{"}@b{Foreground}"}
@end flushright
@sp 1

Specifies background color to use when drawing active elements.
An element (a widget or portion of a widget) is active if the
mouse cursor is positioned over the element and pressing a mouse button
will cause some action to occur.
@end table


@table @asis
@item @code{@b{:activeborderwidth}}
@flushright
Name=@code{"@b{activeBorderWidth}@r{"} Class=@code{"}@b{BorderWidth}"}
@end flushright
@sp 1

Specifies a non-negative value indicating
the width of the 3-D border drawn around active elements.  See above for
definition of active elements.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
This option is typically only available in widgets displaying more
than one element at a time (e.g. menus but not buttons).
@end table


@table @asis
@item @code{@b{:activeforeground}}
@flushright
Name=@code{"@b{activeForeground}@r{"} Class=@code{"}@b{Background}"}
@end flushright
@sp 1

Specifies foreground color to use when drawing active elements.
See above for definition of active elements.
@end table


@table @asis
@item @code{@b{:anchor}}
@flushright
Name=@code{"@b{anchor}@r{"} Class=@code{"}@b{Anchor}"}
@end flushright
@sp 1

Specifies how the information in a widget (e.g. text or a bitmap)
is to be displayed in the widget.
Must be one of the values @b{n}@r{, }@b{ne}@r{, }@b{e}@r{, }@b{se},
@b{s}@r{, }@b{sw}@r{, }@b{w}@r{, }@b{nw}@r{, or }@b{center}.
For example, @b{nw} means display the information such that its
top-left corner is at the top-left corner of the widget.
@end table


@table @asis
@item @code{@b{:background or :bg}}
@flushright
Name=@code{"@b{background}@r{"} Class=@code{"}@b{Background}"}
@end flushright
@sp 1

Specifies the normal background color to use when displaying the
widget.
@end table


@table @asis
@item @code{@b{:bitmap}}
@flushright
Name=@code{"@b{bitmap}@r{"} Class=@code{"}@b{Bitmap}"}
@end flushright
@sp 1

Specifies a bitmap to display in the widget, in any of the forms
acceptable to @b{Tk_GetBitmap}.
The exact way in which the bitmap is displayed may be affected by
other options such as @b{anchor}@r{ or }@b{justify}.
Typically, if this option is specified then it overrides other
options that specify a textual value to display in the widget;
the @b{bitmap} option may be reset to an empty string to re-enable
a text display.
@end table


@table @asis
@item @code{@b{:borderwidth or :bd}}
@flushright
Name=@code{"@b{borderWidth}@r{"} Class=@code{"}@b{BorderWidth}"}
@end flushright
@sp 1

Specifies a non-negative value indicating the width
of the 3-D border to draw around the outside of the widget (if such a
border is being drawn;  the @b{relief} option typically determines
this).  The value may also be used when drawing 3-D effects in the
interior of the widget.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
@end table


@table @asis
@item @code{@b{:cursor}}
@flushright
Name=@code{"@b{cursor}@r{"} Class=@code{"}@b{Cursor}"}
@end flushright
@sp 1

Specifies the mouse cursor to be used for the widget.
The value may have any of the forms acceptable to @b{Tk_GetCursor}.
@end table


@table @asis
@item @code{@b{:cursorbackground}}
@flushright
Name=@code{"@b{cursorBackground}@r{"} Class=@code{"}@b{Foreground}"}
@end flushright
@sp 1

Specifies the color to use as background in the area covered by the
insertion cursor.  This color will normally override either the normal
background for the widget (or the selection background if the insertion
cursor happens to fall in the selection).
\fIThis option is obsolete and is gradually being replaced by
the @b{insertBackground}@r{ option.}
@end table


@table @asis
@item @code{@b{:cursorborderwidth}}
@flushright
Name=@code{"@b{cursorBorderWidth}@r{"} Class=@code{"}@b{BorderWidth}"}
@end flushright
@sp 1

Specifies a non-negative value indicating the width
of the 3-D border to draw around the insertion cursor.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
\fIThis option is obsolete and is gradually being replaced by
the @b{insertBorderWidth}@r{ option.}
@end table


@table @asis
@item @code{@b{:cursorofftime}}
@flushright
Name=@code{"@b{cursorOffTime}@r{"} Class=@code{"}@b{OffTime}"}
@end flushright
@sp 1

Specifies a non-negative integer value indicating the number of
milliseconds the cursor should remain ``off'' in each blink cycle.
If this option is zero then the cursor doesn't blink:  it is on
all the time.
\fIThis option is obsolete and is gradually being replaced by
the @b{insertOffTime}@r{ option.}
@end table


@table @asis
@item @code{@b{:cursorontime}}
@flushright
Name=@code{"@b{cursorOnTime}@r{"} Class=@code{"}@b{OnTime}"}
@end flushright
@sp 1

Specifies a non-negative integer value indicating the number of
milliseconds the cursor should remain ``on'' in each blink cycle.
\fIThis option is obsolete and is gradually being replaced by
the @b{insertOnTime}@r{ option.}
@end table


@table @asis
@item @code{@b{:cursorwidth}}
@flushright
Name=@code{"@b{cursorWidth}@r{"} Class=@code{"}@b{CursorWidth}"}
@end flushright
@sp 1

Specifies a  value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
If a border has been specified for
the cursor (using the @b{cursorBorderWidth} option), the border
will be drawn inside the width specified by the @b{cursorWidth}
option.
\fIThis option is obsolete and is gradually being replaced by
the @b{insertWidth}@r{ option.}
@end table


@table @asis
@item @code{@b{:disabledforeground}}
@flushright
Name=@code{"@b{disabledForeground}@r{"} Class=@code{"}@b{DisabledForeground}"}
@end flushright
@sp 1

Specifies foreground color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
case on monochrome displays), disabled elements are drawn with the
normal fooreground color but they are dimmed by drawing them
with a stippled fill pattern.
@end table


@table @asis
@item @code{@b{:exportselection}}
@flushright
Name=@code{"@b{exportSelection}@r{"} Class=@code{"}@b{ExportSelection}"}
@end flushright
@sp 1

Specifies whether or not a selection in the widget should also be
the X selection.
The value may have any of the forms accepted by @b{Tcl_GetBoolean},
such as @b{true}@r{, }@b{false}@r{, }@b{0}@r{, }@b{1}@r{, }@b{yes}@r{, or }@b{no}.
If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval
requests when it has a selection.  The default is usually for widgets
to export selections.
@end table


@table @asis
@item @code{@b{:font}}
@flushright
Name=@code{"@b{font}@r{"} Class=@code{"}@b{Font}"}
@end flushright
@sp 1

Specifies the font to use when drawing text inside the widget.
@end table


@table @asis
@item @code{@b{:foreground or :fg}}
@flushright
Name=@code{"@b{foreground}@r{"} Class=@code{"}@b{Foreground}"}
@end flushright
@sp 1

Specifies the normal foreground color to use when displaying the widget.
@end table


@table @asis
@item @code{@b{:geometry}}
@flushright
Name=@code{"@b{geometry}@r{"} Class=@code{"}@b{Geometry}"}
@end flushright
@sp 1

Specifies the desired geometry for the widget's window, in the
form @i{width}@b{x}@i{height}@r{, where }@i{width} is the desired
width of the window and @i{height} is the desired height.  The
units for @i{width}@r{ and }@i{height} depend on the particular
widget.  For widgets displaying text the units are usually the
size of the characters in the font being displayed;  for other
widgets the units are usually pixels.
@end table


@table @asis
@item @code{@b{:insertbackground}}
@flushright
Name=@code{"@b{insertBackground}@r{"} Class=@code{"}@b{Foreground}"}
@end flushright
@sp 1

Specifies the color to use as background in the area covered by the
insertion cursor.  This color will normally override either the normal
background for the widget (or the selection background if the insertion
cursor happens to fall in the selection).
@end table


@table @asis
@item @code{@b{:insertborderwidth}}
@flushright
Name=@code{"@b{insertBorderWidth}@r{"} Class=@code{"}@b{BorderWidth}"}
@end flushright
@sp 1

Specifies a non-negative value indicating the width
of the 3-D border to draw around the insertion cursor.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
@end table


@table @asis
@item @code{@b{:insertofftime}}
@flushright
Name=@code{"@b{insertOffTime}@r{"} Class=@code{"}@b{OffTime}"}
@end flushright
@sp 1

Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``off'' in each blink cycle.
If this option is zero then the cursor doesn't blink:  it is on
all the time.
@end table


@table @asis
@item @code{@b{:insertontime}}
@flushright
Name=@code{"@b{insertOnTime}@r{"} Class=@code{"}@b{OnTime}"}
@end flushright
@sp 1

Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``on'' in each blink cycle.
@end table


@table @asis
@item @code{@b{:insertwidth}}
@flushright
Name=@code{"@b{insertWidth}@r{"} Class=@code{"}@b{InsertWidth}"}
@end flushright
@sp 1

Specifies a  value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
If a border has been specified for the insertion
cursor (using the @b{insertBorderWidth} option), the border
will be drawn inside the width specified by the @b{insertWidth}
option.
@end table


@table @asis
@item @code{@b{:orient}}
@flushright
Name=@code{"@b{orient}@r{"} Class=@code{"}@b{Orient}"}
@end flushright
@sp 1

For widgets that can lay themselves out with either a horizontal
or vertical orientation, such as scrollbars, this option specifies
which orientation should be used.  Must be either @b{horizontal}
or @b{vertical} or an abbreviation of one of these.
@end table


@table @asis
@item @code{@b{:padx}}
@flushright
Name=@code{"@b{padX}@r{"} Class=@code{"}@b{Pad}"}
@end flushright
@sp 1

Specifies a non-negative value indicating how much extra space
to request for the widget in the X-direction.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
When computing how large a window it needs, the widget will
add this amount to the width it would normally need (as determined
by the width of the things displayed in the widget);  if the geometry
manager can satisfy this request, the widget will end up with extra
internal space to the left and/or right of what it displays inside.
@end table


@table @asis
@item @code{@b{:pady}}
@flushright
Name=@code{"@b{padY}@r{"} Class=@code{"}@b{Pad}"}
@end flushright
@sp 1

Specifies a non-negative value indicating how much extra space
to request for the widget in the Y-direction.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
When computing how large a window it needs, the widget will add
this amount to the height it would normally need (as determined by
the height of the things displayed in the widget);  if the geometry
manager can satisfy this request, the widget will end up with extra
internal space above and/or below what it displays inside.
@end table


@table @asis
@item @code{@b{:relief}}
@flushright
Name=@code{"@b{relief}@r{"} Class=@code{"}@b{Relief}"}
@end flushright
@sp 1

Specifies the 3-D effect desired for the widget.  Acceptable
values are @b{raised}@r{, }@b{sunken}@r{, }@b{flat}@r{, }@b{ridge},
and @b{groove}.
The value
indicates how the interior of the widget should appear relative
to its exterior;  for example, @b{raised} means the interior of
the widget should appear to protrude from the screen, relative to
the exterior of the widget.
@end table


@table @asis
@item @code{@b{:repeatdelay}}
@flushright
Name=@code{"@b{repeatDelay}@r{"} Class=@code{"}@b{RepeatDelay}"}
@end flushright
@sp 1

Specifies the number of milliseconds a button or key must be held
down before it begins to auto-repeat.  Used, for example, on the
up- and down-arrows in scrollbars.
@end table


@table @asis
@item @code{@b{:repeatinterval}}
@flushright
Name=@code{"@b{repeatInterval}@r{"} Class=@code{"}@b{RepeatInterval}"}
@end flushright
@sp 1

Used in conjunction with @b{repeatDelay}:  once auto-repeat
begins, this option determines the number of milliseconds between
auto-repeats.
@end table


@table @asis
@item @code{@b{:scrollcommand}}
@flushright
Name=@code{"@b{scrollCommand}@r{"} Class=@code{"}@b{ScrollCommand}"}
@end flushright
@sp 1

Specifies the prefix for a command used to communicate with scrollbar
widgets.  When the view in the widget's window changes (or
whenever anything else occurs that could change the display in a
scrollbar, such as a change in the total size of the widget's
contents), the widget will
generate a Tcl command by concatenating the scroll command and four
numbers.  The four numbers are, in order:  the total size of the
widget's contents, in unspecified units
(``unit'' is a widget-specific term;  for widgets
displaying text, the unit is a line);  the maximum number of units that
may be displayed at once in the widget's window, given its current size;  the
index of the top-most or left-most unit currently visible in the window
(index 0 corresponds to the first unit); and the index of the bottom-most
or right-most unit currently visible in the window.  This command is
then passed to the Tcl interpreter for execution.  Typically the
@b{scrollCommand} option consists of the path name of a scrollbar
widget followed by ``set'', e.g. ``.x.scrollbar set'':  this will cause
the scrollbar to be updated whenever the view in the window changes.
If this option is not specified, then no command will be executed.

The @b{scrollCommand} option is used for widgets that support scrolling
in only one direction.
For widgets that support scrolling in both directions, this
option is replaced with the @b{xScrollCommand}@r{ and }@b{yScrollCommand}
options.
@end table


@table @asis
@item @code{@b{:selectbackground}}
@flushright
Name=@code{"@b{selectBackground}@r{"} Class=@code{"}@b{Foreground}"}
@end flushright
@sp 1

Specifies the background color to use when displaying selected
items.
@end table


@table @asis
@item @code{@b{:selectborderwidth}}
@flushright
Name=@code{"@b{selectBorderWidth}@r{"} Class=@code{"}@b{BorderWidth}"}
@end flushright
@sp 1

Specifies a non-negative value indicating the width
of the 3-D border to draw around selected items.
The value may have any of the forms acceptable to @b{Tk_GetPixels}.
@end table


@table @asis
@item @code{@b{:selectforeground}}
@flushright
Name=@code{"@b{selectForeground}@r{"} Class=@code{"}@b{Background}"}
@end flushright
@sp 1

Specifies the foreground color to use when displaying selected
items.
@end table


@table @asis
@item @code{@b{:setgrid}}
@flushright
Name=@code{"@b{setGrid}@r{"} Class=@code{"}@b{SetGrid}"}
@end flushright
@sp 1

Specifies a boolean value that determines whether this widget controls the
resizing grid for its top-level window.
This option is typically used in text widgets, where the information
in the widget has a natural size (the size of a character) and it makes
sense for the window's dimensions to be integral numbers of these units.
These natural window sizes form a grid.
If the @b{setGrid} option is set to true then the widget will
communicate with the window manager so that when the user interactively
resizes the top-level window that contains the widget, the dimensions of
the window will be displayed to the user in grid units and the window
size will be constrained to integral numbers of grid units.
See the section GRIDDED GEOMETRY MANAGEMENT in the @b{wm} manual
entry for more details.
@end table


@table @asis
@item @code{@b{:text}}
@flushright
Name=@code{"@b{text}@r{"} Class=@code{"}@b{Text}"}
@end flushright
@sp 1

Specifies a string to be displayed inside the widget.  The way in which
the string is displayed depends on the particular widget and may be
determined by other options, such as @b{anchor}@r{ or }@b{justify}.
@end table


@table @asis
@item @code{@b{:textvariable}}
@flushright
Name=@code{"@b{textVariable}@r{"} Class=@code{"}@b{Variable}"}
@end flushright
@sp 1

Specifies the name of a variable.  The value of the variable is a text
string to be displayed inside the widget;  if the variable value changes
then the widget will automatically update itself to reflect the new value.
The way in which the string is displayed in the widget depends on the
particular widget and may be determined by other options, such as
@b{anchor}@r{ or }@b{justify}.
@end table


@table @asis
@item @code{@b{:underline}}
@flushright
Name=@code{"@b{underline}@r{"} Class=@code{"}@b{Underline}"}
@end flushright
@sp 1

Specifies the integer index of a character to underline in the widget.
This option is typically used to indicate keyboard traversal characters
in menu buttons and menu entries.  0 corresponds to the first character
of the text displayed in the widget, 1 to the next character, and so
on.
@end table


@table @asis
@item @code{@b{:xscrollcommand}}
@flushright
Name=@code{"@b{xScrollCommand}@r{"} Class=@code{"}@b{ScrollCommand}"}
@end flushright
@sp 1

Specifies the prefix for a command used to communicate with horizontal
scrollbars.  This option is treated in the same way as the
@b{scrollCommand} option, except that it is used for horizontal
scrollbars associated with widgets that support both horizontal
and vertical scrolling.
See the description of @b{scrollCommand} for complete details
on how this option is used.
@end table


@table @asis
@item @code{@b{:yscrollcommand}}
@flushright
Name=@code{"@b{yScrollCommand}@r{"} Class=@code{"}@b{ScrollCommand}"}
@end flushright
@sp 1

Specifies the prefix for a command used to communicate with vertical
scrollbars.  This option is treated in the same way as the
@b{scrollCommand} option, except that it is used for vertical
scrollbars associated with widgets that support both horizontal
and vertical scrolling.
See the description of @b{scrollCommand} for complete details
on how this option is used.

@end table
@unnumberedsubsec Keywords
class, name, standard option, switch
@node pack-old, pack, options, Control
@section pack-old
@c @cartouche

pack \- Obsolete syntax for packer geometry manager
@unnumberedsubsec Synopsis
@b{pack after }@i{sibling }@i{window options}@r{ ?}@i{window options }...?
@sp 1
@b{pack append }@i{parent }@i{window options}@r{ ?}@i{window options }...?
@sp 1
@b{pack before }@i{sibling }@i{window options}@r{ ?}@i{window options }...?
@sp 1
@b{pack info }@i{parent}
@sp 1
@b{pack unpack }@i{window}
@c @end cartouche

@unnumberedsubsec Description

@i{Note: this manual entry describes the syntax for the }@b{pack}\fI
command as it before Tk version 3.3.
Although this syntax continues to be supported for backward
compatibility, it is obsolete and should not be used anymore.
At some point in the future it may cease to be supported.

The packer is a geometry manager that arranges the
children of a parent by packing them in order around the edges of
the parent.  The first child is placed against one side of
the window, occupying the entire span of the window along that
side.  This reduces the space remaining for other children as
if the side had been moved in by the size of the first child.
Then the next child is placed against one side of the remaining
cavity, and so on until all children have been placed or there
is no space left in the cavity.

The @b{before}@r{, }@b{after}@r{, and }@b{append}@r{ forms of the }@b{pack}
command are used to insert one or more children into the packing order
for their parent.  The @b{before} form inserts the children before
window @i{sibling} in the order;  all of the other windows must be
siblings of @i{sibling}@r{.  The }@b{after} form inserts the windows
after @i{sibling}@r{, and the }@b{append} form appends one or more
windows to the end of the packing order for @i{parent}.  If a
@i{window} named in any of these commands is already packed in
its parent, it is removed from its current position in the packing
order and repositioned as indicated by the command.  All of these
commands return an empty string as result.

The @b{unpack}@r{ form of the }@b{pack}@r{ command removes }@i{window}
from the packing order of its parent and unmaps it.  After the
execution of this command the packer will no longer manage
@i{window}'s geometry.

The placement of each child is actually a four-step process;
the @i{options}@r{ argument following each }@i{window} consists of
a list of one or more fields that govern the placement of that
window.  In the discussion below, the term @i{cavity} refers
to the space left in a parent when a particular child is placed
(i.e. all the space that wasn't claimed by earlier children in
the packing order).  The term @i{parcel} refers to the space
allocated to a particular child;  this is not necessarily the
same as the child window's final geometry.

The first step in placing a child is to determine which side of
the cavity it will lie against.  Any one of the following options
may be used to specify a side:

@table @asis
@item @b{top}
Position the child's parcel against the top of the cavity,
occupying the full width of the cavity.
@item @b{bottom}
Position the child's parcel against the bottom of the cavity,
occupying the full width of the cavity.
@item @b{left}
Position the child's parcel against the left side of the cavity,
occupying the full height of the cavity.
@item @b{right}
Position the child's parcel against the right side of the cavity,
occupying the full height of the cavity.
@end table


At most one of these options should be specified for any given window.
If no side is specified, then the default is @b{top}.

The second step is to decide on a parcel for the child.  For @b{top}
and @b{bottom} windows, the desired parcel width is normally the cavity
width and the desired parcel height is the window's requested height,
as passed to @b{Tk_GeometryRequest}@r{. For }@b{left}@r{ and }@b{right}
windows, the desired parcel height is normally the cavity height and the
desired width is the window's requested width.  However, extra
space may be requested for the window using any of the following
options:

@table @asis
@item @b{padx }@i{num}
Add @i{num} pixels to the window's requested width before computing
the parcel size as described above.
@item @b{pady }@i{num}
Add @i{num} pixels to the window's requested height before computing
the parcel size as described above.
@item @b{expand}
This option requests that the window's parcel absorb any extra space left over
in the parent's cavity after packing all the children.
The amount of space left over depends on the sizes requested by the
other children, and may be zero.  If several windows have all specified
@b{expand} then the extra width will be divided equally among all the
@b{left}@r{ and }@b{right}@r{ windows that specified }@b{expand} and
the extra height will be divided equally among all the @b{top} and
@b{bottom}@r{ windows that specified }@b{expand}.
@end table


If the desired width or height for a parcel is larger than the corresponding
dimension of the cavity, then the cavity's dimension is used instead.

The third step in placing the window is to decide on the window's
width and height.  The default is for the window to receive either
its requested width and height or the those of the parcel, whichever
is smaller.  If the parcel is larger than the window's requested
size, then the following options may be used to expand the
window to partially or completely fill the parcel:

@table @asis
@item @b{fill}
Set the window's size to equal the parcel size.
@item @b{fillx}
Increase the window's width to equal the parcel's width, but retain
the window's requested height.
@item @b{filly}
Increase the window's height to equal the parcel's height, but retain
the window's requested width.

The last step is to decide the window's location within its parcel.
If the window's size equals the parcel's size, then the window simply
fills the entire parcel.  If the parcel is larger than the window,
then one of
the following options may be used to specify where the window should
be positioned within its parcel:
@item @b{frame center}
Center the window in its parcel.  This is the default if no framing
option is specified.
@item @b{frame n}
Position the window with its top edge centered on the top edge of
the parcel.
@item @b{frame ne}
Position the window with its upper-right corner at the upper-right corner
of the parcel.
@item @b{frame e}
Position the window with its right edge centered on the right edge of
the parcel.
@item @b{frame se}
Position the window with its lower-right corner at the lower-right corner
of the parcel.
@item @b{frame s}
Position the window with its bottom edge centered on the bottom edge of
the parcel.
@item @b{frame sw}
Position the window with its lower-left corner at the lower-left corner
of the parcel.
@item @b{frame w}
Position the window with its left edge centered on the left edge of
the parcel.
@item @b{frame nw}
Position the window with its upper-left corner at the upper-left corner
of the parcel.

The @b{pack info} command may be used to retrieve information about
the packing order for a parent.  It returns a list in the form

@example
@i{window options window options ...}
@end example

Each @i{window}@r{ is a name of a window packed in }@i{parent},
and the following @i{options} describes all of the options for that
window, just as they would be typed to @b{pack append}.
The order of the list is the same as the packing order for
@i{parent}.

The packer manages the mapped/unmapped state of all the packed
children windows.  It automatically maps the windows when it packs
them, and it unmaps any windows for which there was no space left
in the cavity.

The packer makes geometry requests on behalf of the parent windows
it manages.  For each parent window it requests a size large enough
to accommodate all the options specified by all the packed children,
such that zero space would be leftover for @b{expand} options.

@end table
@unnumberedsubsec Keywords
geometry manager, location, packer, parcel, size
@node pack, place, pack-old, Control
@section pack
@c @cartouche

pack \- Geometry manager that packs around edges of cavity
@unnumberedsubsec Synopsis
@b{pack }@i{option arg }@r{?}@i{arg ...}?
@c @end cartouche

@unnumberedsubsec Description

The @b{pack} command is used to communicate with the packer,
a geometry manager that arranges the children of a parent by
packing them in order around the edges of the parent.
The @b{pack} command can have any of several forms, depending
on the @i{option} argument:

@table @asis
@item @b{pack }@i{slave }@r{?}@i{slave ...}@r{? ?}@i{options}?
If the first argument to @b{pack} is a window name (any value
starting with ``.''), then the command is processed in the same
way as @b{pack configure}.
@item @b{pack configure }@i{slave }@r{?}@i{slave ...}@r{? ?}@i{options}?
The arguments consist of the names of one or more slave windows
followed by pairs of arguments that specify how
to manage the slaves.
See ``THE PACKER ALGORITHM'' below for details on how the options
are used by the packer.
The following options are supported:
@item @b{:after }@i{other}
@i{Other} must the name of another window.
Use its master as the master for the slaves, and insert
the slaves just after @i{other} in the packing order.
@item @b{:anchor }@i{anchor}
@i{Anchor}@r{ must be a valid anchor position such as }@b{n}
or @b{sw}; it specifies where to position each slave in its
parcel.
Defaults to @b{center}.
@item @b{:before }@i{other}
@i{Other} must the name of another window.
Use its master as the master for the slaves, and insert
the slaves just before @i{other} in the packing order.
@item @b{:expand }@i{boolean}
Specifies whether the slaves should be expanded to consume
extra space in their master.
@i{Boolean}@r{ may have any proper boolean value, such as }@b{1}
or @b{no}.
Defaults to 0.
@item @b{:fill }@i{style}
If a slave's parcel is larger than its requested dimensions, this
option may be used to stretch the slave.
@i{Style} must have one of the following values:
@table @asis
@item @b{none}
Give the slave its requested dimensions plus any internal padding
requested with @b{:ipadx}@r{ or }@b{:ipady}.  This is the default.
@item @b{x}
Stretch the slave horizontally to fill the entire width of its
parcel (except leave external padding as specified by @b{:padx}).
@item @b{y}
Stretch the slave vertically to fill the entire height of its
parcel (except leave external padding as specified by @b{:pady}).
@item @b{both}
Stretch the slave both horizontally and vertically.
@end table
@item @b{:in }@i{other}
Insert the slave(s) at the end of the packing order for the master
window given by @i{other}.
@item @b{:ipadx }@i{amount}
@i{Amount} specifies how much horizontal internal padding to
leave on each side of the slave(s).
@i{Amount}@r{ must be a valid screen distance, such as }@b{2}@r{ or }@b{.5c}.
It defaults to 0.
@item @b{:ipady }@i{amount}
@i{Amount} specifies how much vertical internal padding to
leave on each side of the slave(s).
@i{Amount}  defaults to 0.
@item @b{:padx }@i{amount}
@i{Amount} specifies how much horizontal external padding to
leave on each side of the slave(s).
@i{Amount} defaults to 0.
@item @b{:pady }@i{amount}
@i{Amount} specifies how much vertical external padding to
leave on each side of the slave(s).
@i{Amount} defaults to 0.
@item @b{:side }@i{side}
Specifies which side of the master the slave(s) will be packed against.
Must be @b{left}@r{, }@b{right}@r{, }@b{top}@r{, or }@b{bottom}.
Defaults to @b{top}.
@end table


If no @b{:in}@r{, }@b{:after}@r{ or }@b{:before} option is specified
then each of the slaves will be inserted at the end of the packing list
for its parent unless it is already managed by the packer (in which
case it will be left where it is).
If one of these options is specified then all the slaves will be
inserted at the specified point.
If any of the slaves are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
than receiving default values.
.RE

@table @asis
@item @b{pack :forget }@i{slave }@r{?}@i{slave ...}?
Removes each of the @i{slave}s from the packing order for its
master and unmaps their windows.
The slaves will no longer be managed by the packer.
@item @b{pack :newinfo }@i{slave}
Returns a list whose elements are the current configuration state of
the slave given by @i{slave} in the same option-value form that
might be specified to @b{pack configure}.
The first two elements of the list are ``@b{:in }@i{master}'' where
@i{master} is the slave's master.
Starting with Tk 4.0 this option will be renamed "pack info".
@item @b{pack :propagate }@i{master}@r{ ?}@i{boolean}?
If @i{boolean}@r{ has a true boolean value such as }@b{1}@r{ or }@b{on}
then propagation is enabled for @i{master}, which must be a window
name (see ``GEOMETRY PROPAGATION'' below).
If @i{boolean} has a false boolean value then propagation is
disabled for @i{master}.
In either of these cases an empty string is returned.
If @i{boolean}@r{ is omitted then the command returns }@b{0} or
@b{1} to indicate whether propagation is currently enabled
for @i{master}.
Propagation is enabled by default.
@item @b{pack :slaves }@i{master}
Returns a list of all of the slaves in the packing order for @i{master}.
The order of the slaves in the list is the same as their order in
the packing order.
If @i{master} has no slaves then an empty string is returned.

@end table
@unnumberedsubsec "The Packer Algorithm"

For each master the packer maintains an ordered list of slaves
called the @i{packing list}.
The @b{:in}@r{, }@b{:after}@r{, and }@b{:before} configuration
options are used to specify the master for each slave and the slave's
position in the packing list.
If none of these options is given for a slave then the slave
is added to the end of the packing list for its parent.

The packer arranges the slaves for a master by scanning the
packing list in order.
At the time it processes each slave, a rectangular area within
the master is still unallocated.
This area is called the @i{cavity};  for the first slave it
is the entire area of the master.

For each slave the packer carries out the following steps:
@itemize @asis{}
@item
[1]
The packer allocates a rectangular @i{parcel} for the slave
along the side of the cavity given by the slave's @b{:side} option.
If the side is top or bottom then the width of the parcel is
the width of the cavity and its height is the requested height
of the slave plus the @b{:ipady}@r{ and }@b{:pady} options.
For the left or right side the height of the parcel is
the height of the cavity and the width is the requested width
of the slave plus the @b{:ipadx}@r{ and }@b{:padx} options.
The parcel may be enlarged further because of the @b{:expand}
option (see ``EXPANSION'' below)
@item
[2]
The packer chooses the dimensions of the slave.
The width will normally be the slave's requested width plus
twice its @b{:ipadx} option and the height will normally be
the slave's requested height plus twice its @b{:ipady}
option.
However, if the @b{:fill}@r{ option is }@b{x}@r{ or }@b{both}
then the width of the slave is expanded to fill the width of the parcel,
minus twice the @b{:padx} option.
If the @b{:fill}@r{ option is }@b{y}@r{ or }@b{both}
then the height of the slave is expanded to fill the width of the parcel,
minus twice the @b{:pady} option.
@item
[3]
The packer positions the slave over its parcel.
If the slave is smaller than the parcel then the @b{:anchor}
option determines where in the parcel the slave will be placed.
If @b{:padx}@r{ or }@b{:pady} is non-zero, then the given
amount of external padding will always be left between the
slave and the edges of the parcel.
@end itemize


Once a given slave has been packed, the area of its parcel
is subtracted from the cavity, leaving a smaller rectangular
cavity for the next slave.
If a slave doesn't use all of its parcel, the unused space
in the parcel will not be used by subsequent slaves.
If the cavity should become too small to meet the needs of
a slave then the slave will be given whatever space is
left in the cavity.
If the cavity shrinks to zero size, then all remaining slaves
on the packing list will be unmapped from the screen until
the master window becomes large enough to hold them again.

@unnumberedsubsec "Expansion"

If a master window is so large that there will be extra space
left over after all of its slaves have been packed, then the
extra space is distributed uniformly among all of the slaves
for which the @b{:expand} option is set.
Extra horizontal space is distributed among the expandable
slaves whose @b{:side}@r{ is }@b{left}@r{ or }@b{right},
and extra vertical space is distributed among the expandable
slaves whose @b{:side}@r{ is }@b{top}@r{ or }@b{bottom}.

@unnumberedsubsec "Geometry Propagation"

The packer normally computes how large a master must be to
just exactly meet the needs of its slaves, and it sets the
requested width and height of the master to these dimensions.
This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows.
However, the @b{pack propagate} command may be used to
turn off propagation for one or more masters.
If propagation is disabled then the packer will not set
the requested width and height of the packer.
This may be useful if, for example, you wish for a master
window to have a fixed size that you specify.

@unnumberedsubsec "Restrictions On Master Windows"

The master for each slave must either be the slave's parent
(the default) or a descendant of the slave's parent.
This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is
visible without danger of the slave being clipped by its parent.

@unnumberedsubsec "Packing Order"

If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
if the slave hasn't been packed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first:  the most recently created window
will be highest in the stacking order.
Or, you can use the @b{raise}@r{ and }@b{lower} commands to change
the stacking order of either the master or the slave.

@unnumberedsubsec Keywords
geometry manager, location, packer, parcel, propagation, size
@node place, raise, pack, Control
@section place
@c @cartouche

place \- Geometry manager for fixed or rubber-sheet placement
@unnumberedsubsec Synopsis
@b{place }@i{window option value }@r{?}@i{option value ...}?
@sp 1
@b{place configure }@i{window option value }@r{?}@i{option value ...}?
@sp 1
@b{place forget }@i{window}
@sp 1
@b{place info }@i{window}
@sp 1
@b{place slaves }@i{window}
@c @end cartouche

@unnumberedsubsec Description

The placer is a geometry manager for Tk.
It provides simple fixed placement of windows, where you specify
the exact size and location of one window, called the @i{slave},
within another window, called the @i{master}.
The placer also provides rubber-sheet placement, where you specify the
size and location of the slave in terms of the dimensions of
the master, so that the slave changes size and location
in response to changes in the size of the master.
Lastly, the placer allows you to mix these styles of placement so
that, for example, the slave has a fixed width and height but is
centered inside the master.

If the first argument to the @b{place} command is a window path
name or @b{configure} then the command arranges for the placer
to manage the geometry of a slave whose path name is @i{window}.
The remaining arguments consist of one or more @i{option:value}
pairs that specify the way in which @i{window}'s
geometry is managed.
If the placer is already managing @i{window}, then the
@i{option:value}@r{ pairs modify the configuration for }@i{window}.
In this form the @b{place} command returns an empty string as result.
The following @i{option:value} pairs are supported:

@table @asis
@item @b{:in }@i{master}
@i{Master} specifes the path name of the window relative
to which @i{window} is to be placed.
@i{Master}@r{ must either be }@i{window}'s parent or a descendant
of @i{window}'s parent.
In addition, @i{master}@r{ and }@i{window} must both be descendants
of the same top-level window.
These restrictions are necessary to guarantee
that @i{window}@r{ is visible whenever }@i{master} is visible.
If this option isn't specified then the master defaults to
@i{window}'s parent.
@item @b{:x }@i{location}
@i{Location} specifies the x-coordinate within the master window
of the anchor point for @i{window}.
The location is specified in screen units (i.e. any of the forms
accepted by @b{Tk_GetPixels}) and need not lie within the bounds
of the master window.
@item @b{:relx }@i{location}
@i{Location} specifies the x-coordinate within the master window
of the anchor point for @i{window}.
In this case the location is specified in a relative fashion
as a floating-point number:  0.0 corresponds to the left edge
of the master and 1.0 corresponds to the right edge of the master.
@i{Location} need not be in the range 0.0\-1.0.
@item @b{:y }@i{location}
@i{Location} specifies the y-coordinate within the master window
of the anchor point for @i{window}.
The location is specified in screen units (i.e. any of the forms
accepted by @b{Tk_GetPixels}) and need not lie within the bounds
of the master window.
@item @b{:rely }@i{location}
@i{Location} specifies the y-coordinate within the master window
of the anchor point for @i{window}.
In this case the value is specified in a relative fashion
as a floating-point number:  0.0 corresponds to the top edge
of the master and 1.0 corresponds to the bottom edge of the master.
@i{Location} need not be in the range 0.0\-1.0.
@item @b{:anchor }@i{where}
@i{Where}@r{ specifies which point of }@i{window} is to be positioned
at the (x,y) location selected by the @b{:x}@r{, }@b{:y},
@b{:relx}@r{, and }@b{:rely} options.
The anchor point is in terms of the outer area of @i{window}
including its border, if any.
Thus if @i{where}@r{ is }@b{se} then the lower-right corner of
@i{window}'s border will appear at the given (x,y) location
in the master.
The anchor position defaults to @b{nw}.
@item @b{:width }@i{size}
@i{Size}@r{ specifies the width for }@i{window} in screen units
(i.e. any of the forms accepted by @b{Tk_GetPixels}).
The width will be the outer width of @i{window} including its
border, if any.
If @i{size}@r{ is an empty string, or if no }@b{:width}
or @b{:relwidth} option is specified, then the width requested
internally by the window will be used.
@item @b{:relwidth }@i{size}
@i{Size}@r{ specifies the width for }@i{window}.
In this case the width is specified as a floating-point number
relative to the width of the master: 0.5 means @i{window} will
be half as wide as the master, 1.0 means @i{window} will have
the same width as the master, and so on.
@item @b{:height }@i{size}
@i{Size}@r{ specifies the height for }@i{window} in screen units
(i.e. any of the forms accepted by @b{Tk_GetPixels}).
The height will be the outer dimension of @i{window} including its
border, if any.
If @i{size}@r{ is an empty string, or if no }@b{:height} or
@b{:relheight} option is specified, then the height requested
internally by the window will be used.
@item @b{:relheight }@i{size}
@i{Size}@r{ specifies the height for }@i{window}.
In this case the height is specified as a floating-point number
relative to the height of the master: 0.5 means @i{window} will
be half as high as the master, 1.0 means @i{window} will have
the same height as the master, and so on.
@item @b{:bordermode }@i{mode}
@i{Mode} determines the degree to which borders within the
master are used in determining the placement of the slave.
The default and most common value is @b{inside}.
In this case the placer considers the area of the master to
be the innermost area of the master, inside any border:
an option of @b{:x 0} corresponds to an x-coordinate just
inside the border and an option of @b{:relwidth 1.0}
means @i{window} will fill the area inside the master's
border.
If @i{mode}@r{ is }@b{outside} then the placer considers
the area of the master to include its border;
this mode is typically used when placing @i{window}
outside its master, as with the options @b{:x 0 :y 0 :anchor ne}.
Lastly, @i{mode}@r{ may be specified as }@b{ignore}, in which
case borders are ignored:  the area of the master is considered
to be its official X area, which includes any internal border but
no external border.  A bordermode of @b{ignore} is probably
not very useful.

If the same value is specified separately with
two different options, such as @b{:x}@r{ and }@b{:relx}, then
the most recent option is used and the older one is ignored.

The @b{place slaves} command returns a list of all the slave
windows for which @i{window} is the master.
If there are no slaves for @i{window} then an empty string is
returned.

The @b{place forget} command causes the placer to stop managing
the geometry of @i{window}.  As a side effect of this command
@i{window} will be unmapped so that it doesn't appear on the
screen.
If @i{window} isn't currently managed by the placer then the
command has no effect.
@b{Place forget} returns an empty string as result.

The @b{place info} command returns a list giving the current
configuration of @i{window}.
The list consists of @i{option:value} pairs in exactly the
same form as might be specified to the @b{place configure}
command.
If the configuration of a window has been retrieved with
@b{place info}, that configuration can be restored later by
first using @b{place forget} to erase any existing information
for the window and then invoking @b{place configure} with
the saved information.

@end table
@unnumberedsubsec "Fine Points"

It is not necessary for the master window to be the parent
of the slave window.
This feature is useful in at least two situations.
First, for complex window layouts it means you can create a
hierarchy of subwindows whose only purpose
is to assist in the layout of the parent.
The ``real children'' of the parent (i.e. the windows that
are significant for the application's user interface) can be
children of the parent yet be placed inside the windows
of the geometry-management hierarchy.
This means that the path names of the ``real children''
don't reflect the geometry-management hierarchy and users
can specify options for the real children
without being aware of the structure of the geometry-management
hierarchy.

A second reason for having a master different than the slave's
parent is to tie two siblings together.
For example, the placer can be used to force a window always to
be positioned centered just below one of its
siblings by specifying the configuration

@example
@b{:in }@i{sibling}@b{ :relx 0.5 :rely 1.0 :anchor n :bordermode outside}
@end example

Whenever the sibling is repositioned in the future, the slave
will be repositioned as well.

Unlike many other geometry managers (such as the packer)
the placer does not make any attempt to manipulate the geometry of
the master windows or the parents of slave windows (i.e. it doesn't
set their requested sizes).
To control the sizes of these windows, make them windows like
frames and canvases that provide configuration options for this purpose.

@unnumberedsubsec Keywords
geometry manager, height, location, master, place, rubber sheet, slave, width
@node raise, selection, place, Control
@section raise
@c @cartouche

raise \- Change a window's position in the stacking order
@unnumberedsubsec Synopsis
@b{raise }@i{window }@r{?}@i{aboveThis}?
@c @end cartouche

@unnumberedsubsec Description

If the @i{aboveThis} argument is omitted then the command raises
@i{window} so that it is above all of its siblings in the stacking
order (it will not be obscured by any siblings and will obscure
any siblings that overlap it).
If @i{aboveThis} is specified then it must be the path name of
a window that is either a sibling of @i{window} or the descendant
of a sibling of @i{window}.
In this case the @b{raise} command will insert
@i{window}@r{ into the stacking order just above }@i{aboveThis}
(or the ancestor of @i{aboveThis}@r{ that is a sibling of }@i{window});
this could end up either raising or lowering @i{window}.

@unnumberedsubsec Keywords
obscure, raise, stacking order
@node selection, send, raise, Control
@section selection
@c @cartouche

selection \- Manipulate the X selection
@unnumberedsubsec Synopsis
@b{selection }@i{option}@r{ ?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

This command provides a Tcl interface to the X selection mechanism and
implements the full selection functionality described in the
X Inter-Client Communication Conventions Manual (ICCCM), except that it
supports only the primary selection.

The first argument to @b{selection} determines the format of the
rest of the arguments and the behavior of the command.  The following
forms are currently supported:

@table @asis
@item @b{selection :clear }@i{window}
If there is a selection anywhere on @i{window}'s display, clear it
so that no window owns the selection anymore.  Returns an empty string.
@item @b{selection :get }@r{?}@i{type}?
Retrieves the value
of the primary selection and returns it as a result.
@b{Type} specifies the form in which the selection is to be
returned (the desired ``target'' for conversion, in ICCCM
terminology), and should be an
atom name such as STRING or FILE_NAME;  see the Inter-Client
Communication Conventions Manual for complete details.
@b{Type} defaults to STRING.  The selection :owner may choose to
return the selection in any of several different representation
formats, such as STRING, ATOM, INTEGER, etc. (this format is
different than the selection type;  see the ICCCM for all the
confusing details).  If the selection is returned in
a non-string format, such as INTEGER or ATOM, the @b{selection}
command converts it to string format as a collection of fields
separated by spaces:  atoms are converted to their
textual names, and anything else is converted to hexadecimal
integers.
@item @b{selection :handle }@i{window command }@r{?}@i{type}@r{? ?}@i{format}?
Creates a handler for selection requests, such that @i{command} will
be executed whenever the primary selection is
owned by @i{window} and someone attempts to retrieve it in the form
given by @i{type}@r{ (e.g. }@i{type}@r{ is specified in the }@b{selection :get}
command).  @i{Type} defaults to STRING.
If @i{command} is an empty string then any existing handler for
@i{window}@r{ and }@i{type} is removed.

When the selection is requested and @i{window} is the selection :owner
and @i{type}@r{ is the requested type, }@i{command} will be executed
as a Tcl command with two additional numbers appended to it
(with space separators).  The two additional numbers
are @i{offset}@r{ and }@i{maxBytes}@r{:  }@i{offset} specifies a starting
character position in the selection and @i{maxBytes} gives the maximum
number of bytes to retrieve.  The command should return a value consisting
of at most @i{maxBytes} of the selection, starting at position
@i{offset}@r{.  For very large selections (larger than }@i{maxBytes})
the selection will be retrieved using several invocations of @i{command}
with increasing @i{offset}@r{ values.  If }@i{command} returns a string
whose length is less than @i{maxBytes}, the return value is assumed to
include all of the remainder of the selection;  if the length of
@i{command}@r{'s result is equal to }@i{maxBytes} then
@i{command} will be invoked again, until it eventually
returns a result shorter than @i{maxBytes}@r{.  The value of }@i{maxBytes}
will always be relatively large (thousands of bytes).

If @i{command} returns an error then the selection retrieval is rejected
just as if the selection didn't exist at all.

The @i{format} argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
Table 2 of the ICCCM), and defaults to STRING.  If @i{format} is
STRING, the selection is transmitted as 8-bit ASCII characters (i.e.
just in the form returned by @i{command}@r{).  If }@i{format} is
ATOM, then the return value from @i{command} is divided into fields
separated by white space;  each field is converted to its atom value,
and the 32-bit atom value is transmitted instead of the atom name.
For any other @i{format}@r{, the return value from }@i{command} is
divided into fields separated by white space and each field is
converted to a 32-bit integer;  an array of integers is transmitted
to the selection requester.

The @i{format} argument is needed only for compatibility with
selection requesters that don't use Tk.  If the Tk toolkit is being
used to retrieve the selection then the value is converted back to
a string at the requesting end, so @i{format} is
irrelevant.
.RE
@item @b{selection :own }@r{?}@i{window}@r{? ?}@i{command}?
If @i{window} is specified, then it becomes the new selection :owner
and the command returns an empty string as result.
The existing owner, if any, is notified that it has lost the selection.
If @i{command} is specified, it is a Tcl script to execute when
some other window claims ownership of the selection away from
@i{window}.
If neither @i{window}@r{ nor }@i{command} is specified then
the command returns the path name of the window in this application
that owns the selection, or an empty string if no window in this
application owns the selection.

@end table
@unnumberedsubsec Keywords
clear, format, handler, ICCCM, own, selection, target, type
@node send, tk, selection, Control
@section send
@c @cartouche

send \- Execute a command in a different interpreter
@unnumberedsubsec Synopsis
@b{send }@i{interp cmd }@r{?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

This command arranges for @i{cmd}@r{ (and }@i{arg}s) to be executed in the
interpreter named by @i{interp}.  It returns the result or
error from that command execution.  @i{Interp} must be the
name of an interpreter registered on the display associated with
the interpreter in which the command is invoked;  it need not
be within the same process or application.  If no @i{arg}
arguments are present, then the command to be executed is
contained entirely within the @i{cmd} argument.  If one or
more @i{arg}s are present, they are concatenated to form the
command to be executed, just as for the @b{eval} Tcl command.

@unnumberedsubsec Security

The @b{send} command is potentially a serious security loophole,
since any application that can connect to your X server can send
scripts to your applications.
These incoming scripts can use Tcl to read and
write your files and invoke subprocesses under your name.
Host-based access control such as that provided by @b{xhost}
is particularly insecure, since it allows anyone with an account
on particular hosts to connect to your server, and if disabled it
allows anyone anywhere to connect to your server.
In order to provide at least a small amount of
security, Tk checks the access control being used by the server
and rejects incoming sends unless (a) @b{xhost}-style access control
is enabled (i.e. only certain hosts can establish connections) and (b) the
list of enabled hosts is empty.
This means that applications cannot connect to your server unless
they use some other form of authorization
such as that provide by @b{xauth}.

@unnumberedsubsec Keywords
interpreter, remote execution, security, send
@node tk, tkerror, send, Control
@section tk
@c @cartouche

tk \- Manipulate Tk internal state
@unnumberedsubsec Synopsis
@b{tk}@r{ }@i{option }@r{?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

The @b{tk} command provides access to miscellaneous
elements of Tk's internal state.
Most of the information manipulated by this command pertains to the
application as a whole, or to a screen or display, rather than to a
particular window.
The command can take any of a number of different forms
depending on the @i{option} argument.  The legal forms are:

@table @asis
@item @b{tk :colormodel }@i{window}@r{ ?}@i{newValue}?
If @i{newValue} isn't specified, this command returns the current
color model in use for @i{window}'s screen, which will be either
@b{color}@r{ or }@b{monochrome}.
If @i{newValue}@r{ is specified, then it must be either }@b{color}
or @b{monochrome} or an abbreviation of one of them;
the color model for @i{window}'s screen is set to this value.
@end table


The color model is used by Tk and its widgets to determine whether
it should display in black and white only or use colors.
A single color model is shared by all of the windows managed by one
process on a given screen.
The color model for a screen is set initially by Tk to @b{monochrome}
if the display has four or fewer bit planes and to @b{color} otherwise.
The color model will automatically be changed from @b{color} to
@b{monochrome} if Tk fails to allocate a color because all entries
in the colormap were in use.
An application can change its own color model at any time (e.g. it
might change the model to @b{monochrome} in order to conserve
colormap entries, or it might set the model to @b{color}
to use color on a four-bit display in special circumstances), but
an application is not allowed to change the color model to @b{color}
unless the screen has at least two bit planes.
.RE

@unnumberedsubsec Keywords
color model, internal state
@node tkerror, tkvars, tk, Control
@section tkerror
@c @cartouche

tkerror \- Command invoked to process background errors
@unnumberedsubsec Synopsis
@b{tkerror }@i{message}
@c @end cartouche

@unnumberedsubsec Description

The @b{tkerror} command doesn't exist as built-in part of Tk.  Instead,
individual applications or users can define a @b{tkerror}
command (e.g. as a Tcl procedure) if they wish to handle background
errors.

A background error is one that occurs in a command that didn't
originate with the application.  For example, if an error occurs
while executing a command specified with a @b{bind}@r{ of }@b{after}
command, then it is a background error.  For a non-background error,
the error can simply be returned up through nested Tcl command
evaluations until it reaches the top-level code in the application;
then the application can report the error in whatever way it
wishes.  When a background error occurs, the unwinding ends in
the Tk library and there is no obvious way for Tk to report
the error.

When Tk detects a background error, it invokes the @b{tkerror}
command, passing it the error message as its only argument.
Tk assumes that the application has implemented the @b{tkerror}
command, and that the command will report the error in a way that
makes sense for the application.  Tk will ignore any result returned
by the @b{tkerror} command.

If another Tcl error occurs within the @b{tkerror} command
then Tk reports the error itself by writing a message
to stderr.

The Tk script library includes a default @b{tkerror} procedure
that posts a dialog box containing the error message and offers
the user a chance to see a stack trace that shows where the
error occurred.

@unnumberedsubsec Keywords
background error, reporting
@node tkvars, tkwait, tkerror, Control
@section tkvars
@c @cartouche

tkvars \- Variables used or set by Tk
@c @end cartouche

@unnumberedsubsec Description

The following Tcl variables are either set or used by Tk at various times
in its execution:

@table @asis
@item @b{tk_library}
Tk sets this variable hold the name of a directory containing a library
of Tcl scripts related to Tk.  These scripts include an initialization
file that is normally processed whenever a Tk application starts up,
plus other files containing procedures that implement default behaviors
for widgets.
The value of this variable is taken from the TK_LIBRARY environment
variable, if one exists, or else from a default value compiled into
Tk.
@item @b{tk_patchLevel}
Contains a decimal integer giving the current patch level for Tk.
The patch level is incremented for each new release or patch, and
it uniquely identifies an official version of Tk.
@item @b{tk_priv}
This variable is an array containing several pieces of information
that are private to Tk.  The elements of @b{tk_priv} are used by
Tk library procedures and default bindings.
They should not be accessed by any code outside Tk.
@item @b{tk_strictMotif}
This variable is set to zero by default.
If an application sets it to one, then Tk attempts to adhere as
closely as possible to Motif look-and-feel standards.
For example, active elements such as buttons and scrollbar
sliders will not change color when the pointer passes over them.
@item @b{tk_version}
Tk sets this variable in the interpreter for each application.
The variable holds the current version number of the Tk
library in the form @i{major}@r{.}@i{minor}@r{.  }@i{Major} and
@i{minor} are integers.  The major version number increases in
any Tk release that includes changes that are not backward compatible
(i.e. whenever existing Tk applications and scripts may have to change to
work with the new release).  The minor version number increases with
each new release of Tk, except that it resets to zero whenever the
major version number changes.
@item @b{tkVersion}
Has the same value as @b{tk_version}.  This variable is obsolete and
will be deleted soon.

@end table
@unnumberedsubsec Keywords
variables, version
@node tkwait, update, tkvars, Control
@section tkwait
@c @cartouche

tkwait \- Wait for variable to change or window to be destroyed
@unnumberedsubsec Synopsis
@*@w{@b{tkwait :variable }@i{name}}@*
@*@w{@b{tkwait :visibility }@i{name}}@*
@b{tkwait :window }@i{name}
@c @end cartouche

@unnumberedsubsec Description

The @b{tkwait} command waits for one of several things to happen,
then it returns without taking any other actions.
The return value is always an empty string.
If the first argument is @b{:variable} (or any abbreviation of
it) then the second argument is the name of a global variable and the
command waits for that variable to be modified.
If the first argument is @b{:visibility} (or any abbreviation
of it) then the second argument is the name of a window and the
@b{tkwait} command waits for a change in its
visibility state (as indicated by the arrival of a VisibilityNotify
event).  This form is typically used to wait for a newly-created
window to appear on the screen before taking some action.
If the first argument is @b{:window} (or any abbreviation
of it) then the second argument is the name of a window and the
@b{tkwait} command waits for that window to be destroyed.
This form is typically used to wait for a user to finish interacting
with a dialog box before using the result of that interaction.

While the @b{tkwait} command is waiting it processes events in
the normal fashion, so the application will continue to respond
to user interactions.

@unnumberedsubsec Keywords
variable, visibility, wait, window
@node update, winfo, tkwait, Control
@section update
@c @cartouche

update \- Process pending events and/or when-idle handlers
@unnumberedsubsec Synopsis
@b{update}@r{ ?}@b{:idletasks}?
@c @end cartouche

@unnumberedsubsec Description

This command is used to bring the entire application world
``up to date.''
It flushes all pending output to the display,  waits for the
server to process that output and return errors or events,
handles all pending events of any sort (including when-idle handlers),
and repeats this set of operations until there are no pending
events, no pending when-idle handlers, no pending output to the server,
and no operations still outstanding at the server.  

If the @b{idletasks} keyword is specified as an argument to the
command, then no new events or errors are processed;  only when-idle
idlers are invoked.
This causes operations that are normally deferred, such as display
updates and window layout calculations, to be performed immediately.

The @b{update :idletasks} command is useful in scripts where
changes have been made to the application's state and you want those
changes to appear on the display immediately, rather than waiting
for the script to complete.
The @b{update} command with no options is useful in scripts where
you are performing a long-running computation but you still want
the application to respond to user interactions;  if you occasionally
call @b{update} then user input will be processed during the
next call to @b{update}.

@unnumberedsubsec Keywords
event, flush, handler, idle, update
@node winfo, wm, update, Control
@section winfo
@c @cartouche

winfo \- Return window-related information
@unnumberedsubsec Synopsis
@b{winfo}@r{ }@i{option }@r{?}@i{arg arg ...}?
@c @end cartouche

@unnumberedsubsec Description

The @b{winfo} command is used to retrieve information about windows
managed by Tk.  It can take any of a number of different forms,
depending on the @i{option} argument.  The legal forms are:

@table @asis
@item @b{winfo :atom }@i{name}
Returns a decimal string giving the integer identifier for the
atom whose name is @i{name}.  If no atom exists with the name
@i{name} then a new one is created.
@item @b{winfo :atomname }@i{id}
Returns the textual name for the atom whose integer identifier is
@i{id}.
This command is the inverse of the @b{winfo :atom} command.
Generates an error if no such atom exists.
@item @b{winfo :cells }@i{window}
Returns a decimal string giving the number of cells in the
color map for @i{window}.
@item @b{winfo :children }@i{window}
Returns a list containing the path names of all the children
of @i{window}.  Top-level windows are returned as children
of their logical parents.
@item @b{winfo :class }@i{window}
Returns the class name for @i{window}.
@item @b{winfo :containing }@i{rootX rootY}
Returns the path name for the window containing the point given
by @i{rootX}@r{ and }@i{rootY}.
@i{RootX}@r{ and }@i{rootY} are specified in screen units (i.e.
any form acceptable to @b{Tk_GetPixels}) in the coordinate
system of the root window (if a virtual-root window manager is in
use then the coordinate system of the virtual root window is used).
If no window in this application contains the point then an empty
string is returned.
In selecting the containing window, children are given higher priority
than parents and among siblings the highest one in the stacking order is
chosen.
@item @b{winfo :depth }@i{window}
Returns a decimal string giving the depth of @i{window} (number
of bits per pixel).
@item @b{winfo :exists }@i{window}
Returns 1 if there exists a window named @i{window}, 0 if no such
window exists.
@item @b{winfo :fpixels }@i{window}@r{ }@i{number}
Returns a floating-point value giving the number of pixels
in @i{window}@r{ corresponding to the distance given by }@i{number}.
@i{Number} may be specified in any of the forms acceptable
to @b{Tk_GetScreenMM}, such as ``2.0c'' or ``1i''.
The return value may be fractional;  for an integer value, use
@b{winfo :pixels}.
@item @b{winfo :geometry }@i{window}
Returns the geometry for @i{window}, in the form
@i{width}@b{x}@i{height}@b{+}@i{x}@b{+}@i{y}.  All dimensions are
in pixels.
@item @b{winfo :height }@i{window}
Returns a decimal string giving @i{window}'s height in pixels.
When a window is first created its height will be 1 pixel;  the
height will eventually be changed by a geometry manager to fulfill
the window's needs.
If you need the true height immediately after creating a widget,
invoke @b{update} to force the geometry manager to arrange it,
or use @b{winfo :reqheight} to get the window's requested height
instead of its actual height.
@item @b{winfo :id }@i{window}
Returns a hexadecimal string indicating the X identifier for @i{window}.
@item @b{winfo :interps}
Returns a list whose members are the names of all Tcl interpreters
(e.g. all Tk-based applications) currently registered for the
display of the invoking application.
@item @b{winfo :ismapped }@i{window}
Returns @b{1}@r{ if }@i{window}@r{ is currently mapped, }@b{0} otherwise.
@item @b{winfo :name }@i{window}
Returns @i{window}'s name (i.e. its name within its parent, as opposed
to its full path name).
The command @b{winfo :name .} will return the name of the application.
@item @b{winfo :parent }@i{window}
Returns the path name of @i{window}'s parent, or an empty string
if @i{window} is the main window of the application.
@item @b{winfo :pathname }@i{id}
Returns the path name of the window whose X identifier is @i{id}.
@i{Id} must be a decimal, hexadecimal, or octal integer and must
correspond to a window in the invoking application.
@item @b{winfo :pixels }@i{window}@r{ }@i{number}
Returns the number of pixels in @i{window} corresponding
to the distance given by @i{number}.
@i{Number} may be specified in any of the forms acceptable
to @b{Tk_GetPixels}, such as ``2.0c'' or ``1i''.
The result is rounded to the nearest integer value;  for a
fractional result, use @b{winfo :fpixels}.
@item @b{winfo :reqheight }@i{window}
Returns a decimal string giving @i{window}'s requested height,
in pixels.  This is the value used by @i{window}'s geometry
manager to compute its geometry.
@item @b{winfo :reqwidth }@i{window}
Returns a decimal string giving @i{window}'s requested width,
in pixels.  This is the value used by @i{window}'s geometry
manager to compute its geometry.
@item @b{winfo :rgb }@i{window color}
Returns a list containing three decimal values, which are the
red, green, and blue intensities that correspond to @i{color} in
the window given by @i{window}@r{.  }@i{Color}
may be specified in any of the forms acceptable for a color
option.
@item @b{winfo :rootx }@i{window}
Returns a decimal string giving the x-coordinate, in the root
window of the screen, of the
upper-left corner of @i{window}@r{'s border (or }@i{window} if it
has no border).
@item @b{winfo :rooty }@i{window}
Returns a decimal string giving the y-coordinate, in the root
window of the screen, of the
upper-left corner of @i{window}@r{'s border (or }@i{window} if it
has no border).
@item @b{winfo :screen }@i{window}
Returns the name of the screen associated with @i{window}, in
the form @i{displayName}@r{.}@i{screenIndex}.
@item @b{winfo :screencells }@i{window}
Returns a decimal string giving the number of cells in the default
color map for @i{window}'s screen.
@item @b{winfo :screendepth }@i{window}
Returns a decimal string giving the depth of the root window
of @i{window}'s screen (number of bits per pixel).
@item @b{winfo :screenheight }@i{window}
Returns a decimal string giving the height of @i{window}'s screen,
in pixels.
@item @b{winfo :screenmmheight }@i{window}
Returns a decimal string giving the height of @i{window}'s screen,
in millimeters.
@item @b{winfo :screenmmwidth }@i{window}
Returns a decimal string giving the width of @i{window}'s screen,
in millimeters.
@item @b{winfo :screenvisual }@i{window}
Returns one of the following strings to indicate the default visual
type for @i{window}@r{'s screen: }@b{directcolor}@r{, }@b{grayscale},
@b{pseudocolor}@r{, }@b{staticcolor}@r{, }@b{staticgray}, or
@b{truecolor}.
@item @b{winfo :screenwidth }@i{window}
Returns a decimal string giving the width of @i{window}'s screen,
in pixels.
@item @b{winfo :toplevel }@i{window}
Returns the path name of the top-level window containing @i{window}.
@item @b{winfo :visual }@i{window}
Returns one of the following strings to indicate the visual
type for @i{window}@r{: }@b{directcolor}@r{, }@b{grayscale},
@b{pseudocolor}@r{, }@b{staticcolor}@r{, }@b{staticgray}, or
@b{truecolor}.
@item @b{winfo :vrootheight }@i{window}
Returns the height of the virtual root window associated with @i{window}
if there is one;  otherwise returns the height of @i{window}'s screen.
@item @b{winfo :vrootwidth }@i{window}
Returns the width of the virtual root window associated with @i{window}
if there is one;  otherwise returns the width of @i{window}'s screen.
@item @b{winfo :vrootx }@i{window}
Returns the x-offset of the virtual root window associated with @i{window},
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for @i{window}.
@item @b{winfo :vrooty }@i{window}
Returns the y-offset of the virtual root window associated with @i{window},
relative to the root window of its screen.
This is normally either zero or negative.
Returns 0 if there is no virtual root window for @i{window}.
@item @b{winfo :width }@i{window}
Returns a decimal string giving @i{window}'s width in pixels.
When a window is first created its width will be 1 pixel;  the
width will eventually be changed by a geometry manager to fulfill
the window's needs.
If you need the true width immediately after creating a widget,
invoke @b{update} to force the geometry manager to arrange it,
or use @b{winfo :reqwidth} to get the window's requested width
instead of its actual width.
@item @b{winfo :x }@i{window}
Returns a decimal string giving the x-coordinate, in @i{window}'s
parent, of the
upper-left corner of @i{window}@r{'s border (or }@i{window} if it
has no border).
@item @b{winfo :y }@i{window}
Returns a decimal string giving the y-coordinate, in @i{window}'s
parent, of the
upper-left corner of @i{window}@r{'s border (or }@i{window} if it
has no border).

@end table
@unnumberedsubsec Keywords
atom, children, class, geometry, height, identifier, information, interpreters,
mapped, parent, path name, screen, virtual root, width, window
@node wm,  , winfo, Control
@section wm
@c @cartouche

wm \- Communicate with window manager
@unnumberedsubsec Synopsis
@b{wm}@r{ }@i{option window }@r{?}@i{args}?
@c @end cartouche

@unnumberedsubsec Description

The @b{wm} command is used to interact with window managers in
order to control such things as the title for a window, its geometry,
or the increments in terms of which it may be resized.  The @b{wm}
command can take any of a number of different forms, depending on
the @i{option} argument.  All of the forms expect at least one
additional argument, @i{window}, which must be the path name of a
top-level window.

The legal forms for the @b{wm} command are:

@table @asis
@item @b{wm :aspect }@i{window}@r{ ?}@i{minNumer minDenom maxNumer maxDenom}?
If @i{minNumer}@r{, }@i{minDenom}@r{, }@i{maxNumer}@r{, and }@i{maxDenom}
are all specified, then they will be passed to the window manager
and the window manager should use them to enforce a range of
acceptable aspect ratios for @i{window}.  The aspect ratio of
@i{window} (width/length) will be constrained to lie
between @i{minNumer}@r{/}@i{minDenom}@r{ and }@i{maxNumer}@r{/}@i{maxDenom}.
If @i{minNumer} etc. are all specified as empty strings, then
any existing aspect ratio restrictions are removed.
If @i{minNumer} etc. are specified, then the command returns an
empty string.  Otherwise, it returns
a Tcl list containing four elements, which are the current values
of @i{minNumer}@r{, }@i{minDenom}@r{, }@i{maxNumer}@r{, and }@i{maxDenom}
(if no aspect restrictions are in effect, then an empty string is
returned).
@item @b{wm :client }@i{window}@r{ ?}@i{name}?
If @i{name}@r{ is specified, this command stores }@i{name} (which
should be the name of
the host on which the application is executing) in @i{window}'s
@b{WM_CLIENT_MACHINE} property for use by the window manager or
session manager.
The command returns an empty string in this case.
If @i{name} isn't specified, the command returns the last name
set in a @b{wm :client}@r{ command for }@i{window}.
If @i{name} is specified as an empty string, the command deletes the
@b{WM_CLIENT_MACHINE}@r{ property from }@i{window}.
@item @b{wm :command }@i{window}@r{ ?}@i{value}?
If @i{value}@r{ is specified, this command stores }@i{value}@r{ in }@i{window}'s
@b{WM_COMMAND} property for use by the window manager or
session manager and returns an empty string.
@i{Value} must have proper list structure;  the elements should
contain the words of the command used to invoke the application.
If @i{value} isn't specified then the command returns the last value
set in a @b{wm :command}@r{ command for }@i{window}.
If @i{value} is specified as an empty string, the command
deletes the @b{WM_COMMAND}@r{ property from }@i{window}.
@item @b{wm :deiconify }@i{window}
Arrange for @i{window} to be displayed in normal (non-iconified) form.
This is done by mapping the window.  If the window has never been
mapped then this command will not map the window, but it will ensure
that when the window is first mapped it will be displayed
in de-iconified form.  Returns an empty string.
@item @b{wm :focusmodel }@i{window}@r{ ?}@b{active}@r{|}@b{passive}?
If @b{active}@r{ or }@b{passive} is supplied as an optional argument
to the command, then it specifies the focus model for @i{window}.
In this case the command returns an empty string.  If no additional
argument is supplied, then the command returns the current focus
model for @i{window}.
An @b{active}@r{ focus model means that }@i{window} will claim the
input focus for itself or its descendants, even at times when
the focus is currently in some other application.  @b{Passive} means that
@i{window} will never claim the focus for itself:  the window manager
should give the focus to @i{window} at appropriate times.  However,
once the focus has been given to @i{window} or one of its descendants,
the application may re-assign the focus among @i{window}'s descendants.
The focus model defaults to @b{passive}@r{, and Tk's }@b{focus} command
assumes a passive model of focussing.
@item @b{wm :frame }@i{window}
If @i{window} has been reparented by the window manager into a
decorative frame, the command returns the X window identifier for
the outermost frame that contains @i{window} (the window whose
parent is the root or virtual root).  If @i{window} hasn't been
reparented by the window manager then the command returns the
X window identifier for @i{window}.
@item @b{wm :geometry }@i{window}@r{ ?}@i{newGeometry}?
If @i{newGeometry}@r{ is specified, then the geometry of }@i{window}
is changed and an empty string is returned.  Otherwise the current
geometry for @i{window} is returned (this is the most recent
geometry specified either by manual resizing or
in a @b{wm :geometry}@r{ command).  }@i{NewGeometry} has
the form @b{=}@i{width}@b{x}@i{height}@b{\(+-}@i{x}@b{\(+-}@i{y}, where
any of @b{=}@r{, }@i{width}@b{x}@i{height}@r{, or }@b{\(+-}@i{x}@b{\(+-}@i{y}
may be omitted.  @i{Width}@r{ and }@i{height} are positive integers
specifying the desired dimensions of @i{window}@r{.  If }@i{window}
is gridded (see GRIDDED GEOMETRY MANAGEMENT below) then the dimensions
are specified in grid units;  otherwise they are specified in pixel
units.  @i{X}@r{ and }@i{y} specify the desired location of
@i{window} on the screen, in pixels.
If @i{x}@r{ is preceded by }@b{+}, it specifies
the number of pixels between the left edge of the screen and the left
edge of @i{window}@r{'s border;  if preceded by }@b{-} then
@i{x} specifies the number of pixels
between the right edge of the screen and the right edge of @i{window}'s
border.  If @i{y}@r{ is preceded by }@b{+} then it specifies the
number of pixels between the top of the screen and the top
of @i{window}@r{'s border;  if }@i{y}@r{ is preceded by }@b{-} then
it specifies the number of pixels between the bottom of @i{window}'s
border and the bottom of the screen.
If @i{newGeometry} is specified as an empty string then any
existing user-specified geometry for @i{window} is cancelled, and
the window will revert to the size requested internally by its
widgets.
@item @b{wm :grid }@i{window}@r{ ?}@i{baseWidth baseHeight widthInc heightInc}?
This command indicates that @i{window} is to be managed as a
gridded window.
It also specifies the relationship between grid units and pixel units.
@i{BaseWidth}@r{ and }@i{baseHeight} specify the number of grid
units corresponding to the pixel dimensions requested internally
by @i{window}@r{ using }@b{Tk_GeometryRequest}@r{.  }@i{WidthInc}
and @i{heightInc} specify the number of pixels in each horizontal
and vertical grid unit.
These four values determine a range of acceptable sizes for
@i{window}, corresponding to grid-based widths and heights
that are non-negative integers.
Tk will pass this information to the window manager;  during
manual resizing, the window manager will restrict the window's size
to one of these acceptable sizes.
Furthermore, during manual resizing the window manager will display
the window's current size in terms of grid units rather than pixels.
If @i{baseWidth} etc. are all specified as empty strings, then
@i{window} will no longer be managed as a gridded window.  If
@i{baseWidth} etc. are specified then the return value is an
empty string.
Otherwise the return value is a Tcl list containing
four elements corresponding to the current @i{baseWidth},
@i{baseHeight}@r{, }@i{widthInc}@r{, and }@i{heightInc};  if
@i{window} is not currently gridded, then an empty string
is returned.
Note: this command should not be needed very often, since the
@b{Tk_SetGrid}@r{ library procedure and the }@b{setGrid} option
provide easier access to the same functionality.
@item @b{wm :group }@i{window}@r{ ?}@i{pathName}?
If @i{pathName} is specified, it gives the path name for the leader of
a group of related windows.  The window manager may use this information,
for example, to unmap all of the windows in a group when the group's
leader is iconified.  @i{PathName} may be specified as an empty string to
remove @i{window}@r{ from any group association.  If }@i{pathName} is
specified then the command returns an empty string;  otherwise it
returns the path name of @i{window}'s current group leader, or an empty
string if @i{window} isn't part of any group.
@item @b{wm :iconbitmap }@i{window}@r{ ?}@i{bitmap}?
If @i{bitmap} is specified, then it names a bitmap in the standard
forms accepted by Tk (see the @b{Tk_GetBitmap} manual entry for details).
This bitmap is passed to the window manager to be displayed in
@i{window}'s icon, and the command returns an empty string.  If
an empty string is specified for @i{bitmap}, then any current icon
bitmap is cancelled for @i{window}.
If @i{bitmap} is specified then the command returns an empty string.
Otherwise it returns the name of
the current icon bitmap associated with @i{window}, or an empty
string if @i{window} has no icon bitmap.
@item @b{wm :iconify }@i{window}
Arrange for @i{window}@r{ to be iconified.  It }@i{window} hasn't
yet been mapped for the first time, this command will arrange for
it to appear in the iconified state when it is eventually mapped.
@item @b{wm :iconmask }@i{window}@r{ ?}@i{bitmap}?
If @i{bitmap} is specified, then it names a bitmap in the standard
forms accepted by Tk (see the @b{Tk_GetBitmap} manual entry for details).
This bitmap is passed to the window manager to be used as a mask
in conjunction with the @b{iconbitmap} option:  where the mask
has zeroes no icon will be displayed;  where it has ones, the bits
from the icon bitmap will be displayed.  If
an empty string is specified for @i{bitmap} then any current icon
mask is cancelled for @i{window} (this is equivalent to specifying
a bitmap of all ones).  If @i{bitmap} is specified
then the command returns an empty string.  Otherwise it
returns the name of the current icon mask associated with
@i{window}, or an empty string if no mask is in effect.
@item @b{wm :iconname }@i{window}@r{ ?}@i{newName}?
If @i{newName} is specified, then it is passed to the window
manager;  the window manager should display @i{newName} inside
the icon associated with @i{window}.  In this case an empty
string is returned as result.  If @i{newName} isn't specified
then the command returns the current icon name for @i{window},
or an empty string if no icon name has been specified (in this
case the window manager will normally display the window's title,
as specified with the @b{wm :title} command).
@item @b{wm :iconposition }@i{window}@r{ ?}@i{x y}?
If @i{x}@r{ and }@i{y} are specified, they are passed to the window
manager as a hint about where to position the icon for @i{window}.
In this case an empty string is returned.  If @i{x}@r{ and }@i{y} are
specified as empty strings then any existing icon position hint is cancelled.
If neither @i{x}@r{ nor }@i{y} is specified, then the command returns
a Tcl list containing two values, which are the current icon position
hints (if no hints are in effect then an empty string is returned).
@item @b{wm :iconwindow }@i{window}@r{ ?}@i{pathName}?
If @i{pathName} is specified, it is the path name for a window to
use as icon for @i{window}@r{: when }@i{window} is iconified then
@i{pathName}@r{ should be mapped to serve as icon, and when }@i{window}
is de-iconified then @i{pathName} will be unmapped again.  If
@i{pathName} is specified as an empty string then any existing
icon window association for @i{window} will be cancelled.  If
the @i{pathName} argument is specified then an empty string is
returned.  Otherwise the command returns the path name of the
current icon window for @i{window}, or an empty string if there
is no icon window currently specified for @i{window}.  Note:
not all window managers support the notion of an icon window.
@item @b{wm :maxsize }@i{window}@r{ ?}@i{width height}?
If @i{width}@r{ and }@i{height}@r{ are specified, then }@i{window}
becomes resizable and @i{width}@r{ and }@i{height} give its
maximum permissible dimensions.
For gridded windows the dimensions are specified in
grid units;  otherwise they are specified in pixel units.
During manual sizing, the window manager
should restrict the window's dimensions to be less than or
equal to @i{width}@r{ and }@i{height}.
If @i{width}@r{ and }@i{height} are specified as empty strings,
then the maximum size option is cancelled for @i{window}.
If @i{width}@r{ and }@i{height} are
specified, then the command returns an empty string.  Otherwise
it returns a Tcl list with two elements, which are the
maximum width and height currently in effect;  if no maximum
dimensions are in effect for @i{window} then an empty
string is returned.  See the sections on geometry management
below for more information.
@item @b{wm :minsize }@i{window}@r{ ?}@i{width height}?
If @i{width}@r{ and }@i{height}@r{ are specified, then }@i{window}
becomes resizable and @i{width}@r{ and }@i{height} give its
minimum permissible dimensions.
For gridded windows the dimensions are specified in
grid units;  otherwise they are specified in pixel units.
During manual sizing, the window manager
should restrict the window's dimensions to be greater than or
equal to @i{width}@r{ and }@i{height}.
If @i{width}@r{ and }@i{height} are specified as empty strings,
then the minimum size option is cancelled for @i{window}.
If @i{width}@r{ and }@i{height} are
specified, then the command returns an empty string.  Otherwise
it returns a Tcl list with two elements, which are the
minimum width and height currently in effect;  if no minimum
dimensions are in effect for @i{window} then an empty
string is returned.  See the sections on geometry management
below for more information.
@item @b{wm :overrideredirect }@i{window}@r{ ?}@i{boolean}?
If @i{boolean} is specified, it must have a proper boolean form and
the override-redirect flag for @i{window} is set to that value.
If @i{boolean}@r{ is not specified then }@b{1}@r{ or }@b{0} is
returned to indicate whether or not the override-redirect flag
is currently set for @i{window}.
Setting the override-redirect flag for a window causes
it to be ignored by the window manager;  among other things, this means
that the window will not be reparented from the root window into a
decorative frame and the user will not be able to manipulate the
window using the normal window manager mechanisms.
@item @b{wm :positionfrom }@i{window}@r{ ?}@i{who}?
If @i{who}@r{ is specified, it must be either }@b{program} or
@b{user}, or an abbreviation of one of these two.  It indicates
whether @i{window}'s current position was requested by the
program or by the user.  Many window managers ignore program-requested
initial positions and ask the user to manually position the window;  if
@b{user} is specified then the window manager should position the
window at the given place without asking the user for assistance.
If @i{who} is specified as an empty string, then the current position
source is cancelled.
If @i{who} is specified, then the command returns an empty string.
Otherwise it returns @b{user}@r{ or }@b{window} to indicate the
source of the window's current position, or an empty string if
no source has been specified yet.  Most window managers interpret
``no source'' as equivalent to @b{program}.
Tk will automatically set the position source to @b{user}
when a @b{wm :geometry} command is invoked, unless the source has
been set explicitly to @b{program}.
@item @b{wm :protocol }@i{window}@r{ ?}@i{name}@r{? ?}@i{command}?
This command is used to manage window manager protocols such as
@b{WM_DELETE_WINDOW}.
@i{Name} is the name of an atom corresponding to a window manager
protocol, such as @b{WM_DELETE_WINDOW}@r{ or }@b{WM_SAVE_YOURSELF}
or @b{WM_TAKE_FOCUS}.
If both @i{name}@r{ and }@i{command}@r{ are specified, then }@i{command}
is associated with the protocol specified by @i{name}.
@i{Name}@r{ will be added to }@i{window}@r{'s }@b{WM_PROTOCOLS}
property to tell the window manager that the application has a
protocol handler for @i{name}@r{, and }@i{command} will
be invoked in the future whenever the window manager sends a
message to the client for that protocol.
In this case the command returns an empty string.
If @i{name}@r{ is specified but }@i{command} isn't, then the current
command for @i{name} is returned, or an empty string if there
is no handler defined for @i{name}.
If @i{command} is specified as an empty string then the current
handler for @i{name} is deleted and it is removed from the
@b{WM_PROTOCOLS}@r{ property on }@i{window};  an empty string is
returned.
Lastly, if neither @i{name}@r{ nor }@i{command} is specified, the
command returns a list of all the protocols for which handlers
are currently defined for @i{window}.
@end table


Tk always defines a protocol handler for @b{WM_DELETE_WINDOW}, even if
you haven't asked for one with @b{wm :protocol}.
If a @b{WM_DELETE_WINDOW} message arrives when you haven't defined
a handler, then Tk handles the message by destroying the window for
which it was received.
.RE

@table @asis
@item @b{wm :sizefrom }@i{window}@r{ ?}@i{who}?
If @i{who}@r{ is specified, it must be either }@b{program} or
@b{user}, or an abbreviation of one of these two.  It indicates
whether @i{window}'s current size was requested by the
program or by the user.  Some window managers ignore program-requested
sizes and ask the user to manually size the window;  if
@b{user} is specified then the window manager should give the
window its specified size without asking the user for assistance.
If @i{who} is specified as an empty string, then the current size
source is cancelled.
If @i{who} is specified, then the command returns an empty string.
Otherwise it returns @b{user}@r{ or }@b{window} to indicate the
source of the window's current size, or an empty string if
no source has been specified yet.  Most window managers interpret
``no source'' as equivalent to @b{program}.
@item @b{wm :state }@i{window}
Returns the current state of @i{window}@r{:  either }@b{normal},
@b{iconic}@r{, or }@b{withdrawn}.
@item @b{wm :title }@i{window}@r{ ?}@i{string}?
If @i{string} is specified, then it will be passed to the window
manager for use as the title for @i{window} (the window manager
should display this string in @i{window}'s title bar).  In this
case the command returns an empty string.  If @i{string} isn't
specified then the command returns the current title for the
@i{window}.  The title for a window defaults to its name.
@item @b{wm :transient }@i{window}@r{ ?}@i{master}?
If @i{master} is specified, then the window manager is informed
that @i{window} is a transient window (e.g. pull-down menu) working
on behalf of @i{master}@r{ (where }@i{master} is the
path name for a top-level window).  Some window managers will use
this information to manage @i{window}@r{ specially.  If }@i{master}
is specified as an empty string then @i{window} is marked as not
being a transient window any more.  If @i{master} is specified,
then the command returns an empty string.  Otherwise the command
returns the path name of @i{window}'s current master, or an
empty string if @i{window} isn't currently a transient window.
@item @b{wm :withdraw }@i{window}
Arranges for @i{window} to be withdrawn from the screen.  This
causes the window to be unmapped and forgotten about by the window
manager.  If the window
has never been mapped, then this command
causes the window to be mapped in the withdrawn state.  Not all
window managers appear to know how to handle windows that are
mapped in the withdrawn state.
Note: it sometimes seems to be necessary to withdraw a
window and then re-map it (e.g. with @b{wm :deiconify}) to get some
window managers to pay attention to changes in window attributes
such as group.

@end table
@unnumberedsubsec "Sources Of Geometry Information"

Size-related information for top-level windows
can come from three sources.
First, geometry requests come from the widgets that are descendants
of a top-level window.
Each widget requests a particular size for itself
by calling @b{Tk_GeometryRequest}.  This information is passed to
geometry managers, which then request large enough sizes for parent
windows so that they can layout the children properly.
Geometry information passes upwards through the window hierarchy
until eventually a particular size is requested for each top-level
window.
These requests are called @i{internal requests} in the discussion
below.
The second source of width and height information is through the
@b{wm :geometry} command.  Third, the user can
request a particular size for a window using the
interactive facilities of the window manager.
The second and third types of geometry requests are called
@i{external requests} in the discussion below;  Tk treats
these two kinds of requests identically.

@unnumberedsubsec "Ungridded Geometry Management"

Tk allows the geometry of a top-level window to be managed in
either of two general ways: ungridded or gridded.
The ungridded form occurs if no @b{wm :grid} command
has been issued for a top-level window.
Ungridded management has several variants.
In the simplest variant of ungridded windows,
no @b{wm :geometry}@r{, }@b{wm :minsize}@r{, or }@b{wm :maxsize}
commands have been invoked either.
In this case, the window's size is
determined totally by the internal requests emanating from the
widgets inside the window:  Tk will ask the window manager not to
permit the user to resize the window interactively.

If a @b{wm :geometry} command is invoked on an ungridded window,
then the size in that command overrides any size requested by the
window's widgets;  from now on, the window's size will be determined
entirely by the most recent information from @b{wm :geometry}
commands.  To go back to using the size requested by the window's
widgets, issue a @b{wm :geometry}@r{ command with an empty }@i{geometry}
string.

To enable interactive resizing of an ungridded window, one or both
of the @b{wm :maxsize}
and @b{wm :minsize} commands must be issued.
The information from these commands will be passed to the window
manager, and size changes within the specified range will be permitted.
For ungridded windows the limits refer to the top-level window's
dimensions in pixels.
If only a @b{wm :maxsize} command is issued then the minimum
dimensions default to 1;  if only a @b{wm :minsize} command is
issued then the maximum dimensions default to the size of the display.
If the size of a window is changed interactively, it has the same
effect as if @b{wm :geometry} had been invoked:  from now on, internal
geometry requests will be ignored.
To return to internal control over the window's size, issue a
@b{wm :geometry}@r{ command with an empty }@i{geometry} argument.
If a window has been manually resized or moved, the @b{wm :geometry}
command will return the geometry that was requested interactively.

@unnumberedsubsec "Gridded Geometry Management"

The second style of geometry management is called @i{gridded}.
This approach occurs when one of the widgets of an application
supports a range of useful sizes.
This occurs, for example, in a text editor where the scrollbars,
menus, and other adornments are fixed in size but the edit widget
can support any number of lines of text or characters per line.
In this case, it is usually desirable to let the user specify the
number of lines or characters-per-line, either with the
@b{wm :geometry} command or by interactively resizing the window.
In the case of text, and in other interesting cases also, only
discrete sizes of the window make sense, such as integral numbers
of lines and characters-per-line;  arbitrary pixel sizes are not useful.

Gridded geometry management provides support for this kind of
application.
Tk (and the window manager) assume that there is a grid of some
sort within the application and that the application should be
resized in terms of @i{grid units} rather than pixels.
Gridded geometry management is typically invoked by turning on
the @b{setGrid} option for a widget;  it can also be invoked
with the @b{wm :grid}@r{ command or by calling }@b{Tk_SetGrid}.
In each of these approaches the particular widget (or sometimes
code in the application as a whole) specifies the relationship between 
integral grid sizes for the window and pixel sizes.
To return to non-gridded geometry management, invoke
@b{wm :grid} with empty argument strings.

When gridded geometry management is enabled then all the dimensions specified
in @b{wm :minsize}@r{, }@b{wm :maxsize}@r{, and }@b{wm :geometry} commands
are treated as grid units rather than pixel units.
Interactive resizing is automatically enabled, and it will be
carried out in even numbers of grid units rather than pixels.
By default there are no limits on the minimum or maximum dimensions
of a gridded window.
As with ungridded windows, interactive resizing has exactly the
same effect as invoking the @b{wm :geometry} command.
For gridded windows, internally- and externally-requested dimensions
work together: the externally-specified width and height determine
the size of the window in grid units, and the information from the
last @b{wm :grid} command maps from grid units to pixel units.

@unnumberedsubsec Bugs

The window manager interactions seem too complicated, especially
for managing geometry.  Suggestions on how to simplify this would
be greatly appreciated.

Most existing window managers appear to have bugs that affect the
operation of the @b{wm} command.  For example, some changes won't
take effect if the window is already active:  the window will have
to be withdrawn and de-iconified in order to make the change happen.

@unnumberedsubsec Keywords
aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager