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
|
# This file is a Tcl script to test out Tk's interactions with the window
# manager, including the "wm" command. It is organized in the standard fashion
# for Tcl tests.
#
# Copyright © 1992-1994 The Regents of the University of California.
# Copyright © 1994-1997 Sun Microsystems, Inc.
# Copyright © 1998-1999 Scriptics Corporation.
# All rights reserved.
# This file tests window manager interactions that work across platforms.
# Window manager tests that only work on a specific platform should be placed
# in unixWm.test or winWm.test.
package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
image create photo icon -data {
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAA
CBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/w
D/AP+gvaeTAAAACXBIWXMAArQNAAK0DQEdFIm+AAAJQElEQVRYw+WXW2xdV5nHf/ty7lc
f2/FxYsdOnMSNC0HTpDiRKJWAQjWCEQNUSEAFfUOiQqrEC2+IxwpemDLSzNBBCCQeQEKq
RJgBSikiuGlN22TqhsR27OPL8eWc43Pdt7X22osHHydOm4FBPM6Slr69paX9/32Xtb614
f/7MP6vC3O5f8L3G7HJyZPHBwfz5wrF7HQ6nRwxLTOhQuU4PW+z3eq9Xa+33rq9cms7k8
pHjvfS3w8wOfk52u1u8oHpiUff897JJ8+dO/nI6LHho6OjQ3ahkMYwTTZ2O2zXutS3G/7
ayubq7Vtr/7Ve2f7RytLam4ViXq1t/vRvB0ilPsjzz3+LZ5/9j7MzM5Nf/8hj5//5H97/
YNbK5hkfTFLMxAEQQvD766v0yBGIEBEEuPUGi9dv7lx77cb3Vm9vfqc0WNi9evUKWr/xL
h3rfuLj45+l0bjM7m768U98/OJ/fulLH/3wiemxeCafxRcKw7TJxKC+12RpbYdAx7HsOC
rSRNpg+sQQj1w8nS0N5h8JAvm+rWr99ZmZB2qWdZq9vWt/GWBm5im+9rUn6HRGPv7EE4/
++2P/eOFkV0FkJTDQgCaXTbO1tcV2R2EmCxBJQixs2+R9EwV00MFAceJE2ZiZOT7VaTsP
LyxU5orFTK1cfphq9bX7A8zOfoV8Ps3c3NsXPvWpD37vc5//0ETNt8gNjDAzlsdAE0vli
TCRxEhnC2CaRIZNMmZiaonv9mh1PcrDJQZzCfK5OGNjQ8e2tvZO37y5+ctk0naq1fn7A4
yOnmd5uVp4/PGHn/vylz8xe+zoEIP5JAMpA0OHeK6DG4TEk2li8ThaQxRpIg0q6DGUNjg
6UuLYSInhYoYoigiCgHQ6TrGYnlpd3Q1ffvk3L128+ITe2Hj1XoBLl55menqcbDb1haee
evyrDz102tJaE7ctLBMqG1X23Ag7kcKOJzAADSilCVWEZdmMDaXJJCxSiRimaaK1RkqJ7
/uUSlk6Hed0oxG9HI9bm+Pjs2xsvIp5AKC15oUX/lA8f/7MF2dnz8YADMNASslypYqrUx
SHyqSy+f31hzaRZRpMDKVYr+7y4usVri1WWavWCWSIZZkYhoFSIRcuTI1MTAw9OTf33Tu
7zz54SCRinD17/Pzs7AMPFQqZPlTE8vo2DlmGhgbo12BffD/8SmukitiuNxHKoDwyzPJG
nTdXmtiWwdnRNCN5GxWGDA/nOH26/NGpqSfHgPU7AJcuPc0nP/kBrl698YGZmYmMEIJmx
6Hn+my0DUZGC6gIzEOnhu4Lh2GEbRocGyxRSO/7c3QgiRuEVOtdEvEQrSN8IVEq5MSJ4Y
lSKX3OMKJ14G4KnnnmM9bkZPk92VyKy3M3eentJjd3FUYyjxuEeELt7/NoP+eBVAipCFX
EsYE4xcydYFIeSHKynOXhUwM0mh32egH1tsdL16oo007kcskHs7kYly49fRcALqby+fQo
pklkZ4jHY3g6gQgjHF/QcgQdV+7DHJoGmnzSQuvD0QGlIsJQkU4luLXR4kgxxcRgjM1mQ
CyZHrv0sUe4JwKFXMmu7/VSXV9xaXqI0YzC8328QOJ4gq4raHQDGt2AtitwfIEbSAwibO
vdJ7pSCiElR3IxGh2X5Y0GV66v0wnAsq3MN5759L1FqKMoCkQoX19u0QkkD47lKSYiTh1
NoSLYafu0ehrTNNBaE2mNUop2z+DEUJKBbPxecSEIgoAoUjwwmmZpdZPlmuL4oIFWkbx8
rXIvQMfZ9p2e1xBCstOJcFe6nB1NcWokhW1ZHMkazK90qXXDfZFII0NFIBW/XQiZHraoN
bsU81mmjhbxfZ8gCAiCgELKQitJGCoIQ6SQO//2ze/fm4Kf/Px50dzr3Aoch1Ap2o4kn8
tgW/sHynAxzcVTBQYzFp4v6boBjidwfcFCpcmPf7/Oz+ZrvPBalb12D9/370DUGk1evr6
NacWIfD/yveDmXq3F3NxzdwH+5dkfUq8155rb9dA2QcqQcjFx57DRGgaySR47d4RHZ0pY
eh/C9QSOJ3EECGWw3fJZ323j+x6e5xH4Pgu3d6g0FMWUjdvu7bo9/5oK1d0IzM09hwhCG
rvNubXFylI2pum4AZXtDqEURFGE1hoNxGMW5ZyB22nS8wQ9r1+QvsDzBc1uQGW7jee6eN
4+RMfxMdHkYgatWmtur9ZaOnD8TgQMA27c+uH68s3KT8O9BoYBv3pjkxuVGo7Tw+1/MAh
83lreYm1P9r3fT4XjSVxf4voC1/NwHAfXdXFcB891KGVjhO2e16q3fzR2cjQwDPPeZrSx
8SqXL2/RqDU2EnH7I8dPjQ8v7Tqs1RwmSzEsQoQQSBHw1lKVha0AEUb4IiQQIb4I8YUkk
CHTQwa5WIjne9xY2mT+VouRfI7NxfVfrK8sfTuRSAavXP3Xd7fjavWPRq1+3TeiQTVcGn
h0oHwktlZzmBq0SNsRQgiuXLvNL/+nQU/aBFL1xSW+kAghEb5PEkE5q3Bdl7dv72LGCrT
Xdzf+9Nb8N5dXfrG6Wf1jeNDP3nkjigOFWm2xpvx0+tjI8LnMYMnMxQT5eIjruVye36LS
TRAqRSD3vZdCIqUgEj5R4CEDj2O5kMZei3rHoLXV6Sy88cp3Fhf/ew6IAAGE9wOIARmtw
9Tu7vKa1yY+Wiqeee+ZYdsi4HdvrjK/HiKUiZQhoZREQhDJAC18tPSIhEfouwSuQ9cx2V
xpNK/PX/n+4uKvXwQdAAHgA/J+AAaQABJRJOydnVsrzZ1O13eMcSuezC61LJzQRgY+KvC
JhI+WPpH0IAywIkEhaVIupAhdHS0t3F66Nv/iD9bW/nAFtAM4QA9wAXX3RnEvQBoYODSL
+fzEmalTsx+emjl3YWjsaMlMpcwg0ggZEimFoSNsI8JSCtF1wtpmdWt1aeGVSuW133leY
wNoA01gr297BzVwv/8CA0gBBaDYtzkw87ns6PhI+czM0JHjp/PFUjmZSmUM07RCKUPP6X
Vae/Vqfbdys1ZbvOX5ja2+ULcP0Opbt18H/G8Ah+shDWQPzVQ/RSnLTGRsO5U0TMuMVKj
C0PUjLd1+fgPAOxTybl9YcvdC9VcBDobV3x0JINm3MfYbmdX/hu57FfZFDgot6Fe8eqfw
3wLwzvVmX9jsvx8AHEAcnn91/BlySEFKTpuCtgAAABN0RVh0QXV0aG9yAHdhcnN6YXdpY
W5rYQy+S5cAAABYdEVYdENvcHlyaWdodABDQzAgUHVibGljIERvbWFpbiBEZWRpY2F0aW
9uIGh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL3B1YmxpY2RvbWFpbi96ZXJvLzEuMC/
G4735AAAAIXRFWHRDcmVhdGlvbiBUaW1lADIwMTAtMDMtMjlUMDg6MDg6MzD47LxwAAAA
JXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTA4LTE1VDIwOjU0OjM5LTA0OjAwNBT3DQAAACV0R
Vh0ZGF0ZTptb2RpZnkAMjAyMS0wOC0xNVQyMDo1NDoxMS0wNDowMDSDBqsAAADIelRYdE
Rlc2NyaXB0aW9uAAAY042OwQqCQBCGn6B3GOy+Cl0qTAjEc1HRJVhWHXUrd2pmLXr7tDr
VpcMP838w/F+wxxxyprsgB2ALclAxtRAbaBirRdB4f5mHoTeuJlUxYoly8nRRxHW4HahO
30SvmI5Y+CCBF4dPhzg0CYwOLs45GdKfG+sKhBuy2H4xUlM1i76+BhcBwwirLj/bAlJqj
XXzP9UyxmuHzp8feiknLPW6Q/H9moy3yK1oqvROUE2yH99suX45PwEyf2MTOoCNrQAAAB
l0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABWdEVYdFNvdXJjZQBodHR
wczovL29wZW5jbGlwYXJ0Lm9yZy9kZXRhaWwvMzUyMzMvdGFuZ28taW5ldHJuZXQtd2Vi
LWJyb3dzZXItYnktd2Fyc3phd2lhbmth5nAuRgAAACB0RVh0VGl0bGUAdGFuZ28gaW5ld
HJuZXQgd2ViIGJyb3dzZXLyr62TAAAAAElFTkSuQmCC
}
wm deiconify .
if {![winfo ismapped .]} {
tkwait visibility .
}
proc stdWindow {} {
destroy .t
toplevel .t -width 100 -height 50
wm geom .t +0+0
update
}
testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# [raise] and [lower] may return before the window manager has completed the
# operation. The raiseDelay procedure idles for a while to give the operation
# a chance to complete.
#
proc raiseDelay {} {
after 100;
update
update idletasks
}
# How to carry out a small delay while processing events
proc eventDelay {{delay 200}} {
after $delay "set done 1" ; vwait done
}
deleteWindows
##############################################################################
stdWindow
test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body {
wm
} -result {wrong # args: should be "wm option window ?arg ...?"}
# Next test will fail every time set of subcommands is changed
test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body {
wm foo
} -result {bad option "foo": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbadge, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}
test wm-1.3 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body {
wm command
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-1.4 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body {
wm aspect bogus
} -result {bad window path name "bogus"}
test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} -body {
button .b -text hello
wm geometry .b
} -returnCodes error -cleanup {
destroy .b
} -result {window ".b" isn't a top-level window}
### wm aspect ###
test wm-aspect-1.1 {usage} -returnCodes error -body {
wm aspect
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-aspect-1.2 {usage} -returnCodes error -body {
wm aspect . _
} -result {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}
test wm-aspect-1.3 {usage} -returnCodes error -body {
wm aspect . _ _ _
} -result {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}
test wm-aspect-1.4 {usage} -returnCodes error -body {
wm aspect . _ _ _ _ _
} -result {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}
test wm-aspect-1.5 {usage} -returnCodes error -body {
wm aspect . bad 14 15 16
} -result {expected integer but got "bad"}
test wm-aspect-1.6 {usage} -returnCodes error -body {
wm aspect . 13 foo 15 16
} -result {expected integer but got "foo"}
test wm-aspect-1.7 {usage} -returnCodes error -body {
wm aspect . 13 14 bar 16
} -result {expected integer but got "bar"}
test wm-aspect-1.8 {usage} -returnCodes error -body {
wm aspect . 13 14 15 baz
} -result {expected integer but got "baz"}
test wm-aspect-1.9 {usage} -returnCodes error -body {
wm aspect . 0 14 15 16
} -result {aspect number can't be <= 0}
test wm-aspect-1.10 {usage} -returnCodes error -body {
wm aspect . 13 0 15 16
} -result {aspect number can't be <= 0}
test wm-aspect-1.11 {usage} -returnCodes error -body {
wm aspect . 13 14 0 16
} -result {aspect number can't be <= 0}
test wm-aspect-1.12 {usage} -returnCodes error -body {
wm aspect . 13 14 15 0
} -result {aspect number can't be <= 0}
test wm-aspect-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm aspect .t]
wm aspect .t 3 4 10 2
lappend result [wm aspect .t]
wm aspect .t {} {} {} {}
lappend result [wm aspect .t]
} -result [list {} {3 4 10 2} {}]
### wm attributes ###
test wm-attributes-1.1 {usage} -returnCodes error -body {
wm attributes
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-attributes-1.2.1 {usage} -constraints win -returnCodes error -body {
wm attributes . _
} -result {bad attribute "_": must be -alpha, -disabled, -fullscreen, -toolwindow, -topmost, or -transparentcolor}
test wm-attributes-1.2.2 {usage} -constraints win -returnCodes error -body {
wm attributes . -alpha 1.0 -disabled
} -result {wrong # args: should be "wm attributes window ?-alpha ?double?? ?-transparentcolor ?color?? ?-disabled ?bool?? ?-fullscreen ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}
test wm-attributes-1.2.3 {usage} -constraints win -returnCodes error -body {
wm attributes . -to
} -result {bad attribute "-to": must be -alpha, -disabled, -fullscreen, -toolwindow, -topmost, or -transparentcolor}
test wm-attributes-1.2.4 {usage} -constraints {unix notAqua} -returnCodes error -body {
wm attributes . _
} -result {bad attribute "_": must be -alpha, -fullscreen, -topmost, -type, or -zoomed}
test wm-attributes-1.2.5 {usage} -constraints aqua -returnCodes error -body {
wm attributes . _
} -result {bad attribute "_": must be -alpha, -fullscreen, -modified, -notify, -titlepath, -topmost, -transparent, or -type}
### wm client ###
test wm-client-1.1 {usage} -returnCodes error -body {
wm client
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-client-1.2 {usage} -returnCodes error -body {
wm client . _ _
} -result {wrong # args: should be "wm client window ?name?"}
test wm-client-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm client .t]
wm client .t Miffo
lappend result [wm client .t]
wm client .t {}
lappend result [wm client .t]
} -result [list {} Miffo {}]
deleteWindows
test wm-attributes-1.3.0 {default -fullscreen value} -constraints win -body {
toplevel .t
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 0
test wm-attributes-1.3.1 {change -fullscreen before map} -constraints win -body {
toplevel .t
wm attributes .t -fullscreen 1
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.2 {change -fullscreen before map} -constraints win -body {
toplevel .t
wm attributes .t -fullscreen 1
update
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.3 {change -fullscreen after map} -constraints win -body {
toplevel .t
update
wm attributes .t -fullscreen 1
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.4 {change -fullscreen after map} -setup {
set booleans [list]
} -constraints win -body {
toplevel .t
update
lappend booleans [wm attributes .t -fullscreen]
wm attributes .t -fullscreen 1
lappend booleans [wm attributes .t -fullscreen]
# Query above should not clear fullscreen state
lappend booleans [wm attributes .t -fullscreen]
wm attributes .t -fullscreen 0
lappend booleans [wm attributes .t -fullscreen]
} -cleanup {
deleteWindows
} -result {0 1 1 0}
test wm-attributes-1.3.5 {change -fullscreen after map} -setup {
set results [list]
set normal_geom "301x302+101+102"
set fullscreen_geom "[winfo screenwidth .]x[winfo screenheight .]+0+0"
} -constraints win -body {
toplevel .t
wm geom .t $normal_geom
update
lappend results [string equal [wm geom .t] $normal_geom]
wm attributes .t -fullscreen 1
lappend results [string equal [wm geom .t] $fullscreen_geom]
wm attributes .t -fullscreen 0
lappend results [string equal [wm geom .t] $normal_geom]
} -cleanup {
deleteWindows
} -result {1 1 1}
test wm-attributes-1.3.6 {state change does not change -fullscreen} -constraints win -body {
toplevel .t
update
wm attributes .t -fullscreen 1
wm withdraw .t
wm deiconify .t
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.7 {state change does not change -fullscreen} -constraints win -body {
toplevel .t
update
wm attributes .t -fullscreen 1
wm iconify .t
wm deiconify .t
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.8 {override-redirect not compatible with fullscreen attribute} -constraints win -body {
toplevel .t
update
wm overrideredirect .t 1
wm attributes .t -fullscreen 1
} -returnCodes error -cleanup {
deleteWindows
} -result {can't set fullscreen attribute for ".t": override-redirect flag is set}
test wm-attributes-1.3.9 {max height too small} -constraints win -body {
toplevel .t
update
wm maxsize .t 5000 450
wm attributes .t -fullscreen 1
} -returnCodes error -cleanup {
deleteWindows
} -result {can't set fullscreen attribute for ".t": max width/height is too small}
test wm-attributes-1.3.10 {max height too small} -constraints win -body {
toplevel .t
update
wm maxsize .t 450 5000
wm attributes .t -fullscreen 1
} -returnCodes error -cleanup {
deleteWindows
} -result {can't set fullscreen attribute for ".t": max width/height is too small}
test wm-attributes-1.3.11 {another attribute, then -fullscreen} -constraints win -body {
toplevel .t
update
wm attributes .t -alpha 1.0 -fullscreen 1
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.3.12 {another attribute, then -fullscreen, then another} -constraints win -body {
toplevel .t
update
wm attributes .t -toolwindow 0 -fullscreen 1 -topmost 0
wm attributes .t -fullscreen
} -cleanup {
deleteWindows
} -result 1
test wm-attributes-1.4.0 {setting/unsetting fullscreen does not change the focus} -setup {
set results [list]
} -constraints win -body {
focus -force .
toplevel .t
lower .t
update
lappend results [focus]
wm attributes .t -fullscreen 1
eventDelay
lappend results [focus]
wm attributes .t -fullscreen 0
eventDelay
lappend results [focus]
} -cleanup {
deleteWindows
} -result {. . .}
test wm-attributes-1.4.1 {setting fullscreen does not generate FocusIn on wrapper create} -setup {
catch {unset focusin}
} -constraints win -body {
focus -force .
toplevel .t
pack [entry .t.e]
lower .t
bind .t <FocusIn> {lappend focusin %W}
eventDelay
lappend focusin 1
focus -force .t.e
eventDelay
lappend focusin 2
wm attributes .t -fullscreen 1
eventDelay
lappend focusin 3
wm attributes .t -fullscreen 0
eventDelay
lappend focusin final [focus]
} -cleanup {
bind . <FocusIn> {}
bind .t <FocusIn> {}
deleteWindows
} -result {1 .t .t.e 2 3 final .t.e}
test wm-attributes-1.5.0 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .t
lappend results [wm stackorder .]
eventDelay
lappend results [wm stackorder .]
# Default stacking is on top of other windows on the display. Setting the
# fullscreen attribute does not change this.
wm attributes .t -fullscreen 1
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {. {. .t} {. .t}}
test wm-attributes-1.5.1 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .t
lower .t
eventDelay
lappend results [wm stackorder .]
# If stacking order is explicitly set, then setting the fullscreen
# attribute should not change it.
wm attributes .t -fullscreen 1
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {{.t .} {.t .}}
test wm-attributes-1.5.2 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .t
# lower forces the window to be mapped, it would not be otherwise
lower .t
lappend results [wm stackorder .]
# If stacking order is explicitly set for an unmapped window, then setting
# the fullscreen attribute should not change it.
wm attributes .t -fullscreen 1
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {{.t .} {.t .}}
test wm-attributes-1.5.3 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .t
eventDelay
lappend results [wm stackorder .]
wm attributes .t -fullscreen 1
eventDelay
lappend results [wm stackorder .]
# Unsetting the fullscreen attribute should not change the stackorder.
wm attributes .t -fullscreen 0
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {{. .t} {. .t} {. .t}}
test wm-attributes-1.5.4 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .t
lower .t
eventDelay
lappend results [wm stackorder .]
wm attributes .t -fullscreen 1
eventDelay
lappend results [wm stackorder .]
# Unsetting the fullscreen attribute should not change the stackorder.
wm attributes .t -fullscreen 0
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {{.t .} {.t .} {.t .}}
test wm-attributes-1.5.5 {fullscreen stackorder} -setup {
set results [list]
} -constraints win -body {
toplevel .a
toplevel .b
toplevel .c
raise .a
raise .b
raise .c
eventDelay
lappend results [wm stackorder .]
wm attributes .b -fullscreen 1
eventDelay
lappend results [wm stackorder .]
# Unsetting the fullscreen attribute should not change the stackorder.
wm attributes .b -fullscreen 0
eventDelay
lappend results [wm stackorder .]
} -cleanup {
deleteWindows
} -result {{. .a .b .c} {. .a .b .c} {. .a .b .c}}
stdWindow
### wm colormapwindows ###
test wm-colormapwindows-1.1 {usage} -returnCodes error -body {
wm colormapwindows
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-colormapwindows-1.2 {usage} -returnCodes error -body {
wm colormapwindows . _ _
} -result {wrong # args: should be "wm colormapwindows window ?windowList?"}
test wm-colormapwindows-1.3 {usage} -returnCodes error -body {
wm colormapwindows . "a \{"
} -result {unmatched open brace in list}
test wm-colormapwindows-1.4 {usage} -returnCodes error -body {
wm colormapwindows . foo
} -result {bad window path name "foo"}
test wm-colormapwindows-2.1 {reading values} -body {
toplevel .t2 -width 200 -height 200 -colormap new
wm geom .t2 +0+0
frame .t2.a -width 100 -height 30
frame .t2.b -width 100 -height 30 -colormap new
pack .t2.a .t2.b -side top
update
set x [wm colormapwindows .t2]
frame .t2.c -width 100 -height 30 -colormap new
pack .t2.c -side top
update
list $x [wm colormapwindows .t2]
} -cleanup {
destroy .t2
} -result {{.t2.b .t2} {.t2.b .t2.c .t2}}
test wm-colormapwindows-2.2 {setting and reading values} -body {
toplevel .t2 -width 200 -height 200
wm geom .t2 +0+0
frame .t2.a -width 100 -height 30
frame .t2.b -width 100 -height 30
frame .t2.c -width 100 -height 30
pack .t2.a .t2.b .t2.c -side top
wm colormapwindows .t2 {.t2.b .t2.a}
wm colormapwindows .t2
} -cleanup {
destroy .t2
} -result {.t2.b .t2.a}
### wm command ###
test wm-command-1.1 {usage} -returnCodes error -body {
wm command
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-command-1.2 {usage} -returnCodes error -body {
wm command . _ _
} -result {wrong # args: should be "wm command window ?value?"}
test wm-command-1.3 {usage} -returnCodes error -body {
wm command . "a \{"
} -result {unmatched open brace in list}
test wm-command-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm command .t]
wm command .t [list Miffo Foo]
lappend result [wm command .t]
wm command .t {}
lappend result [wm command .t]
} -result [list {} [list Miffo Foo] {}]
### wm deiconify ###
test wm-deiconify-1.1 {usage} -returnCodes error -body {
wm deiconify
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-deiconify-1.2 {usage} -returnCodes error -body {
wm deiconify . _
} -result {wrong # args: should be "wm deiconify window"}
test wm-deiconify-1.3 {usage} -returnCodes error -body {
wm deiconify _
} -result {bad window path name "_"}
test wm-deiconify-1.4 {usage} -setup {
destroy .icon
} -body {
toplevel .icon -width 50 -height 50 -bg red
wm iconwindow .t .icon
wm deiconify .icon
} -returnCodes error -cleanup {
destroy .icon
} -result {can't deiconify .icon: it is an icon for .t}
# test embedded window for Windows
test wm-deiconify-1.5 {usage} -constraints win -setup {
destroy .embed
} -body {
frame .t.f -container 1
toplevel .embed -use [winfo id .t.f]
wm deiconify .embed
} -returnCodes error -cleanup {
destroy .t.f .embed
} -result {can't deiconify .embed: the container does not support the request}
# test embedded window for other platforms
test wm-deiconify-1.6 {usage} -constraints !win -setup {
destroy .embed
} -body {
frame .t.f -container 1
toplevel .embed -use [winfo id .t.f]
wm deiconify .embed
} -returnCodes error -cleanup {
destroy .t.f .embed
} -result {can't deiconify .embed: it is an embedded window}
deleteWindows
test wm-deiconify-2.1 {a window that has never been mapped\
should not be mapped by a call to deiconify} -body {
toplevel .t
wm deiconify .t
winfo ismapped .t
} -cleanup {
deleteWindows
} -result 0
test wm-deiconify-2.2 {a window that has already been\
mapped should be mapped by deiconify} -body {
toplevel .t
update idletasks
wm withdraw .t
wm deiconify .t
winfo ismapped .t
} -cleanup {
deleteWindows
} -result 1
test wm-deiconify-2.3 {geometry for an unmapped window\
should not be calculated by a call to deiconify,\
it should be done at idle time} -setup {
set results {}
} -body {
toplevel .t -width 200 -height 200
lappend results [wm geometry .t]
wm deiconify .t
lappend results [wm geometry .t]
update idletasks
lappend results [lindex [split \
[wm geometry .t] +] 0]
} -cleanup {
deleteWindows
} -result {1x1+0+0 1x1+0+0 200x200}
test wm-deiconify-2.4 {invoking destroy after a deiconify\
should not result in a crash because of a callback\
set on the toplevel} -body {
toplevel .t
wm withdraw .t
wm deiconify .t
destroy .t
update
} -cleanup {
deleteWindows
}
### wm focusmodel ###
test wm-focusmodel-1.1 {usage} -returnCodes error -body {
wm focusmodel
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-focusmodel-1.2 {usage} -returnCodes error -body {
wm focusmodel . _ _
} -result {wrong # args: should be "wm focusmodel window ?active|passive?"}
test wm-focusmodel-1.3 {usage} -returnCodes error -body {
wm focusmodel . bogus
} -result {bad argument "bogus": must be active or passive}
stdWindow
test wm-focusmodel-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm focusmodel .t]
wm focusmodel .t active
lappend result [wm focusmodel .t]
wm focusmodel .t passive
lappend result [wm focusmodel .t]
} -result {passive active passive}
### wm frame ###
test wm-frame-1.1 {usage} -returnCodes error -body {
wm frame
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-frame-1.2 {usage} -returnCodes error -body {
wm frame . _
} -result {wrong # args: should be "wm frame window"}
### wm geometry ###
test wm-geometry-1.1 {usage} -returnCodes error -body {
wm geometry
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-geometry-1.2 {usage} -returnCodes error -body {
wm geometry . _ _
} -result {wrong # args: should be "wm geometry window ?newGeometry?"}
test wm-geometry-1.3 {usage} -returnCodes error -body {
wm geometry . bogus
} -result {bad geometry specifier "bogus"}
test wm-geometry-2.1 {setting values} -body {
wm geometry .t 150x150+50+50
update
set result [wm geometry .t]
wm geometry .t {}
update
return [list $result [string equal [wm geometry .t] $result]]
} -cleanup {
unset result
} -match glob -result [list 150x150+*+* 0]
### wm grid ###
test wm-grid-1.1 {usage} -returnCodes error -body {
wm grid
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-grid-1.2 {usage} -returnCodes error -body {
wm grid . _
} -result {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}
test wm-grid-1.3 {usage} -returnCodes error -body {
wm grid . _ _ _
} -result {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}
test wm-grid-1.4 {usage} -returnCodes error -body {
wm grid . _ _ _ _ _
} -result {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}
test wm-grid-1.5 {usage} -returnCodes error -body {
wm grid . bad 14 15 16
} -result {expected integer but got "bad"}
test wm-grid-1.6 {usage} -returnCodes error -body {
wm grid . 13 foo 15 16
} -result {expected integer but got "foo"}
test wm-grid-1.7 {usage} -returnCodes error -body {
wm grid . 13 14 bar 16
} -result {expected integer but got "bar"}
test wm-grid-1.8 {usage} -returnCodes error -body {
wm grid . 13 14 15 baz
} -result {expected integer but got "baz"}
test wm-grid-1.9 {usage} -returnCodes error -body {
wm grid . -1 14 15 16
} -result {baseWidth can't be < 0}
test wm-grid-1.10 {usage} -returnCodes error -body {
wm grid . 13 -1 15 16
} -result {baseHeight can't be < 0}
test wm-grid-1.11 {usage} -returnCodes error -body {
wm grid . 13 14 -1 16
} -result {widthInc can't be <= 0}
test wm-grid-1.12 {usage} -returnCodes error -body {
wm grid . 13 14 15 -1
} -result {heightInc can't be <= 0}
test wm-grid-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm grid .t]
wm grid .t 3 4 10 2
lappend result [wm grid .t]
wm grid .t {} {} {} {}
lappend result [wm grid .t]
} -result [list {} {3 4 10 2} {}]
### wm group ###
test wm-group-1.1 {usage} -returnCodes error -body {
wm group
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-group-1.2 {usage} -returnCodes error -body {
wm group .t 12 13
} -result {wrong # args: should be "wm group window ?pathName?"}
test wm-group-1.3 {usage} -returnCodes error -body {
wm group .t bogus
} -result {bad window path name "bogus"}
test wm-group-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm group .t]
wm group .t .
lappend result [wm group .t]
wm group .t {}
lappend result [wm group .t]
} -result [list {} . {}]
### wm iconbadge ###
test wm-iconbadge-1.1 {usage} -body {
wm iconbadge
} -returnCodes error -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconbadge-1.2 {usage} -body {
frame .f
set ::tk::icons::base_icon(.f) icon
wm iconbadge .f icon
} -cleanup {
destroy .f
unset ::tk::icons::base_icon(.f)
} -returnCodes error -result {window ".f" isn't a top-level window}
test wm-iconbadge-1.3 {::tk::icons::base_icon($win) must be set on X11} -constraints {
x11
} -setup {
unset -nocomplain ::tk::icons::base_icon(.)
} -body {
wm iconbadge . !
} -returnCodes error -result {::tk::icons::base_icon(.) must be set on X11}
test wm-iconbadge-1.4 {::tk::icons::base_icon($win) must be a Tk photo on X11} -constraints {
x11
} -setup {
catch {image delete book}
} -body {
set ::tk::icons::base_icon(.) book
wm iconbadge . 27
} -returnCodes error -result {can't use "book" as iconphoto: not a photo image}
test wm-iconbadge-1.5 {illegal badge number} -body {
image create photo book -data {
R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC
wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM
QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc
0yv+DVSEUuFxIAOw==
}
set ::tk::icons::base_icon(.) book
wm iconbadge . illegal
} -cleanup {
image delete book
} -returnCodes error -result {can't use "illegal" as icon badge}
test wm-iconbadge-1.6 {non-integer badge number} -body {
image create photo book -data {
R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC
wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM
QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc
0yv+DVSEUuFxIAOw==
}
set ::tk::icons::base_icon(.) book
wm iconbadge . 3.2
} -cleanup {
image delete book
} -returnCodes error -result {can't use "3.2" as icon badge}
test wm-iconbadge-1.7 {negative or zero badge number} -body {
image create photo book -data {
R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC
wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM
QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc
0yv+DVSEUuFxIAOw==
}
set ::tk::icons::base_icon(.) book
wm iconbadge . 0
} -cleanup {
image delete book
} -returnCodes error -result {can't use "0" as icon badge}
test wm-iconbadge-1.8 {usage, no need to call iconphoto on aqua or win32} -constraints {
aquaOrWin32
} -body {
wm iconbadge . 3
wm iconbadge . 5000
wm iconbadge . !
wm iconbadge . ""
} -result {}
### wm iconbitmap ###
test wm-iconbitmap-1.1 {usage} -returnCodes error -body {
wm iconbitmap
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconbitmap-1.2.1 {usage} -constraints unix -returnCodes error -body {
wm iconbitmap .t 12 13
} -result {wrong # args: should be "wm iconbitmap window ?bitmap?"}
test wm-iconbitmap-1.2.2 {usage} -constraints win -returnCodes error -body {
wm iconbitmap .t 12 13 14
} -result {wrong # args: should be "wm iconbitmap window ?-default? ?image?"}
test wm-iconbitmap-1.3 {usage} -constraints win -returnCodes error -body {
wm iconbitmap .t 12 13
} -result {illegal option "12" must be "-default"}
test wm-iconbitmap-1.4 {usage} -constraints notAqua -returnCodes error -body {
wm iconbitmap .t bad-bitmap
} -result {bitmap "bad-bitmap" not defined}
test wm-iconbitmap-2.1 {setting and reading values} -constraints notAqua -setup {
set result {}
} -body {
lappend result [wm iconbitmap .t]
wm iconbitmap .t hourglass
lappend result [wm iconbitmap .t]
wm iconbitmap .t {}
lappend result [wm iconbitmap .t]
} -result [list {} hourglass {}]
### wm iconify ###
test wm-iconify-1.1 {usage} -returnCodes error -body {
wm iconify
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconify-1.2 {usage} -returnCodes error -body {
wm iconify .t _
} -result {wrong # args: should be "wm iconify window"}
destroy .t2
test wm-iconify-2.1 {Misc errors} -body {
toplevel .t2
wm overrideredirect .t2 1
wm iconify .t2
} -returnCodes error -cleanup {
destroy .t2
} -result {can't iconify ".t2": override-redirect flag is set}
test wm-iconify-2.2 {Misc errors} -body {
toplevel .t2
wm geom .t2 +0+0
wm transient .t2 .t
wm iconify .t2
} -returnCodes error -cleanup {
destroy .t2
} -result {can't iconify ".t2": it is a transient}
test wm-iconify-2.3 {Misc errors} -body {
toplevel .t2
wm geom .t2 +0+0
wm iconwindow .t .t2
wm iconify .t2
} -returnCodes error -cleanup {
destroy .t2
} -result {can't iconify ".t2": it is an icon for ".t"}
# test embedded window for Windows
test wm-iconify-2.4.1 {Misc errors} -constraints win -setup {
destroy .t2
} -body {
frame .t.f -container 1
toplevel .t2 -use [winfo id .t.f]
wm iconify .t2
} -returnCodes error -cleanup {
destroy .t2 .r.f
} -result {can't iconify ".t2": the container does not support the request}
# test embedded window for other platforms
test wm-iconify-2.4.2 {Misc errors} -constraints !win -setup {
destroy .t2
} -body {
frame .t.f -container 1
toplevel .t2 -use [winfo id .t.f]
wm iconify .t2
} -returnCodes error -cleanup {
destroy .t2 .r.f
} -result {can't iconify ".t2": it is an embedded window}
test wm-iconify-3.1 {iconify behavior} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .t2
wm geom .t2 -0+0
update idletasks
set result [winfo ismapped .t2]
wm iconify .t2
update idletasks
lappend result [winfo ismapped .t2]
} -cleanup {
destroy .t2
} -result {1 0}
### wm iconmask ###
test wm-iconmask-1.1 {usage} -returnCodes error -body {
wm iconmask
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconmask-1.2 {usage} -returnCodes error -body {
wm iconmask .t 12 13
} -result {wrong # args: should be "wm iconmask window ?bitmap?"}
test wm-iconmask-1.3 {usage} -returnCodes error -body {
wm iconmask .t bad-bitmap
} -result {bitmap "bad-bitmap" not defined}
test wm-iconmask-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm iconmask .t]
wm iconmask .t hourglass
lappend result [wm iconmask .t]
wm iconmask .t {}
lappend result [wm iconmask .t]
} -result [list {} hourglass {}]
### wm iconname ###
test wm-iconname-1.1 {usage} -returnCodes error -body {
wm iconname
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconname-1.2 {usage} -returnCodes error -body {
wm iconname .t 12 13
} -result {wrong # args: should be "wm iconname window ?newName?"}
test wm-iconname-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm iconname .t]
wm iconname .t ThisIconHasAName
lappend result [wm iconname .t]
wm iconname .t {}
lappend result [wm iconname .t]
} -result [list {} ThisIconHasAName {}]
### wm iconphoto ###
test wm-iconphoto-1.1 {usage} -returnCodes error -body {
wm iconphoto
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconphoto-1.2 {usage} -returnCodes error -body {
wm iconphoto .
} -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}
test wm-iconphoto-1.3 {usage} -returnCodes error -body {
wm iconphoto . notanimage
} -result {can't use "notanimage" as iconphoto: not a photo image}
test wm-iconphoto-1.4 {usage} -returnCodes error -body {
# we currently have no return info
wm iconphoto . -default
} -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}
test wm-iconphoto-1.5.1 {usage} -constraints aquaOrWin32 -returnCodes error -body {
wm iconphoto . -default [image create photo -file {}]
} -match {glob} -result {failed to create an iconphoto with image *}
test wm-iconphoto-1.5.2 {usage} -constraints x11 -body {
wm iconphoto . -default [image create photo -file {}]
} -result {}
# All other iconphoto tests are platform specific
### wm iconposition ###
test wm-iconposition-1.1 {usage} -returnCodes error -body {
wm iconposition
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconposition-1.2 {usage} -returnCodes error -body {
wm iconposition .t 12
} -result {wrong # args: should be "wm iconposition window ?x y?"}
test wm-iconposition-1.3 {usage} -returnCodes error -body {
wm iconposition .t 12 13 14
} -result {wrong # args: should be "wm iconposition window ?x y?"}
test wm-iconposition-1.4 {usage} -returnCodes error -body {
wm iconposition .t bad 13
} -result {expected integer but got "bad"}
test wm-iconposition-1.5 {usage} -returnCodes error -body {
wm iconposition .t 13 lousy
} -result {expected integer but got "lousy"}
test wm-iconposition-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm iconposition .t]
wm iconposition .t 10 20
lappend result [wm iconposition .t]
wm iconposition .t {} {}
lappend result [wm iconposition .t]
} -result [list {} {10 20} {}]
### wm iconwindow ###
test wm-iconwindow-1.1 {usage} -returnCodes error -body {
wm iconwindow
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-iconwindow-1.2 {usage} -returnCodes error -body {
wm iconwindow .t 12 13
} -result {wrong # args: should be "wm iconwindow window ?pathName?"}
test wm-iconwindow-1.3 {usage} -returnCodes error -body {
wm iconwindow .t bogus
} -result {bad window path name "bogus"}
test wm-iconwindow-1.4 {usage} -setup {
destroy .b
} -body {
button .b -text Help
wm iconwindow .t .b
} -returnCodes error -cleanup {
destroy .b
} -result {can't use .b as icon window: not at top level}
test wm-iconwindow-1.5 {usage} -setup {
destroy .icon .t2
} -body {
toplevel .icon -width 50 -height 50 -bg green
toplevel .t2
wm geom .t2 -0+0
wm iconwindow .t2 .icon
wm iconwindow .t .icon
} -returnCodes error -cleanup {
destroy .t2 .icon
} -result {.icon is already an icon for .t2}
test wm-iconwindow-2.1 {setting and reading values} -setup {
destroy .icon
set result {}
} -body {
lappend result [wm iconwindow .t]
toplevel .icon -width 50 -height 50 -bg green
wm iconwindow .t .icon
lappend result [wm iconwindow .t]
wm iconwindow .t {}
destroy .icon
lappend result [wm iconwindow .t]
} -result {{} .icon {}}
### wm maxsize ###
test wm-maxsize-1.1 {usage} -returnCodes error -body {
wm maxsize
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-maxsize-1.2 {usage} -returnCodes error -body {
wm maxsize . a
} -result {wrong # args: should be "wm maxsize window ?width height?"}
test wm-maxsize-1.3 {usage} -returnCodes error -body {
wm maxsize . a b c
} -result {wrong # args: should be "wm maxsize window ?width height?"}
test wm-maxsize-1.4 {usage} -returnCodes error -body {
wm maxsize . x 100
} -result {expected integer but got "x"}
test wm-maxsize-1.5 {usage} -returnCodes error -body {
wm maxsize . 100 bogus
} -result {expected integer but got "bogus"}
test wm-maxsize-1.6 {usage} -setup {
destroy .t2
} -body {
toplevel .t2
wm maxsize .t2 300 200
wm maxsize .t2
} -cleanup {
destroy .t2
} -result {300 200}
test wm-maxsize-1.7 {maxsize must be <= screen size} -setup {
destroy .t
} -body {
toplevel .t
lassign [wm maxsize .t] t_width t_height
set s_width [winfo screenwidth .t]
set s_height [winfo screenheight .t]
expr {($t_width <= $s_width) && ($t_height <= $s_height)}
} -cleanup {
destroy .t
} -result 1
destroy .t
test wm-maxsize-2.1 {setting the maxsize to a value smaller\
than the current size will resize a toplevel} -body {
toplevel .t -width 300 -height 300
update
wm maxsize .t 200 150
# UpdateGeometryInfo invoked at idle
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {200 150}
test wm-maxsize-2.2 {setting the maxsize to a value smaller\
than the current size will resize a gridded toplevel} -body {
toplevel .t
wm grid .t 0 0 50 50
wm geometry .t 6x6
update
wm maxsize .t 4 3
# UpdateGeometryInfo invoked at idle
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {4 3}
test wm-maxsize-2.3 {attempting to resize to a value\
bigger than the current maxsize will set it to the max size} -body {
toplevel .t -width 200 -height 200
wm maxsize .t 300 250
update
wm geom .t 400x300
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {300 250}
test wm-maxsize-2.4 {attempting to resize to a value bigger than the\
current maxsize will set it to the max size when gridded} -body {
toplevel .t
wm grid .t 1 1 50 50
wm geom .t 4x4
wm maxsize .t 6 5
update
wm geom .t 8x6
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {6 5}
test wm-maxsize-2.5 {Use max size if window size is not explicitly set\
and the reqWidth/reqHeight are bigger than the max size} -body {
toplevel .t
pack [frame .t.f -width 400 -height 400]
update idletasks
set req [list [winfo reqwidth .t] [winfo reqheight .t]]
wm maxsize .t 300 300
update
list $req [lrange [split [wm geom .t] x+] 0 1]
} -cleanup {
destroy .t
} -result {{400 400} {300 300}}
### wm minsize ###
test wm-minsize-1.1 {usage} -returnCodes error -body {
wm minsize
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-minsize-1.2 {usage} -returnCodes error -body {
wm minsize . a
} -result {wrong # args: should be "wm minsize window ?width height?"}
test wm-minsize-1.3 {usage} -returnCodes error -body {
wm minsize . a b c
} -result {wrong # args: should be "wm minsize window ?width height?"}
test wm-minsize-1.4 {usage} -returnCodes error -body {
wm minsize . x 100
} -result {expected integer but got "x"}
test wm-minsize-1.5 {usage} -returnCodes error -body {
wm minsize . 100 bogus
} -result {expected integer but got "bogus"}
test wm-minsize-1.6 {usage} -setup {
destroy .t2
} -body {
toplevel .t2
wm minsize .t2 300 200
wm minsize .t2
} -cleanup {
destroy .t2
} -result {300 200}
test wm-minsize-2.1 {setting the minsize to a value larger\
than the current size will resize a toplevel} -body {
toplevel .t -width 200 -height 200
update
wm minsize .t 400 300
# UpdateGeometryInfo invoked at idle
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {400 300}
test wm-minsize-2.2 {setting the minsize to a value larger\
than the current size will resize a gridded toplevel} -body {
toplevel .t
wm grid .t 1 1 50 50
wm geom .t 4x4
update
wm minsize .t 8 8
# UpdateGeometryInfo invoked at idle
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {8 8}
test wm-minsize-2.3 {attempting to resize to a value\
smaller than the current minsize will set it to the minsize} -body {
toplevel .t -width 400 -height 400
wm minsize .t 300 300
update
wm geom .t 200x200
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {300 300}
test wm-minsize-2.4 {attempting to resize to a value smaller than the\
current minsize will set it to the minsize when gridded} -body {
toplevel .t
wm grid .t 1 1 50 50
wm geom .t 8x8
wm minsize .t 6 6
update
wm geom .t 4x4
update
lrange [split [wm geom .t] x+] 0 1
} -cleanup {
destroy .t
} -result {6 6}
test wm-minsize-2.5 {Use min size if window size is not explicitly set\
and the reqWidth/reqHeight are smaller than the min size} -setup {
set result [list]
} -body {
toplevel .t
pack [frame .t.f -width 250 -height 250]
update idletasks
lappend result [list [winfo reqwidth .t] [winfo reqheight .t]]
wm minsize .t 300 300
update
lappend result [lrange [split [wm geom .t] x+] 0 1]
} -cleanup {
destroy .t
} -result {{250 250} {300 300}}
stdWindow
### wm overrideredirect ###
test wm-overrideredirect-1.1 {usage} -returnCodes error -body {
wm overrideredirect
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-overrideredirect-1.2 {usage} -returnCodes error -body {
wm overrideredirect .t 1 2
} -result {wrong # args: should be "wm overrideredirect window ?boolean?"}
test wm-overrideredirect-1.3 {usage} -returnCodes error -body {
wm overrideredirect .t boo
} -result {expected boolean value but got "boo"}
test wm-overrideredirect-2.1 {setting and reading values} -setup {
set result {}
} -body {
lappend result [wm overrideredirect .t]
wm overrideredirect .t true
lappend result [wm overrideredirect .t]
wm overrideredirect .t off
lappend result [wm overrideredirect .t]
} -result {0 1 0}
### wm positionfrom ###
test wm-positionfrom-1.1 {usage} -returnCodes error -body {
wm positionfrom
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-positionfrom-1.2 {usage} -returnCodes error -body {
wm positionfrom .t 1 2
} -result {wrong # args: should be "wm positionfrom window ?user/program?"}
test wm-positionfrom-1.3 {usage} -returnCodes error -body {
wm positionfrom .t none
} -result {bad argument "none": must be program or user}
test wm-positionfrom-2.1 {setting and reading values} -setup {
destroy .t2
set result {}
} -body {
toplevel .t2
wm positionfrom .t user
lappend result [wm positionfrom .t]
wm positionfrom .t program
lappend result [wm positionfrom .t]
wm positionfrom .t {}
lappend result [wm positionfrom .t]
} -cleanup {
destroy .t2
} -result {user program {}}
### wm protocol ###
test wm-protocol-1.1 {usage} -returnCodes error -body {
wm protocol
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-protocol-1.2 {usage} -returnCodes error -body {
wm protocol .t 1 2 3
} -result {wrong # args: should be "wm protocol window ?name? ?command?"}
test wm-protocol-2.1 {setting and reading values} -body {
wm protocol .t {foo a} {a b c}
wm protocol .t bar {test script for bar}
wm protocol .t
} -cleanup {
wm protocol .t {foo a} {}
wm protocol .t bar {}
} -result {bar {foo a}}
test wm-protocol-2.2 {setting and reading values} -setup {
set result {}
} -body {
wm protocol .t foo {a b c}
wm protocol .t bar {test script for bar}
lappend result [wm protocol .t foo] [wm protocol .t bar]
wm protocol .t foo {}
wm protocol .t bar {}
lappend result [wm protocol .t foo] [wm protocol .t bar]
} -result {{a b c} {test script for bar} {} {}}
test wm-protocol-2.3 {setting and reading values} -body {
wm protocol .t foo {a b c}
wm protocol .t foo {test script}
wm protocol .t foo
} -cleanup {
wm protocol .t foo {}
} -result {test script}
### wm resizable ###
test wm-resizable-1.1 {usage} -returnCodes error -body {
wm resizable
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-resizable-1.2 {usage} -returnCodes error -body {
wm resizable .t 1
} -result {wrong # args: should be "wm resizable window ?width height?"}
test wm-resizable-1.3 {usage} -returnCodes error -body {
wm resizable .t 1 2 3
} -result {wrong # args: should be "wm resizable window ?width height?"}
test wm-resizable-1.4 {usage} -returnCodes error -body {
wm resizable .t bad 0
} -result {expected boolean value but got "bad"}
test wm-resizable-1.5 {usage} -returnCodes error -body {
wm resizable .t 1 bad
} -result {expected boolean value but got "bad"}
test wm-resizable-2.1 {setting and reading values} {
wm resizable .t 0 0
set result [wm resizable .t]
wm resizable .t 0 1
lappend result [wm resizable .t]
wm resizable .t 1 0
lappend result [wm resizable .t]
wm resizable .t 1 1
lappend result [wm resizable .t]
} {0 0 {0 1} {1 0} {1 1}}
### wm sizefrom ###
test wm-sizefrom-1.1 {usage} -returnCodes error -body {
wm sizefrom
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-sizefrom-1.2 {usage} -returnCodes error -body {
wm sizefrom .t 1 2
} -result {wrong # args: should be "wm sizefrom window ?user|program?"}
test wm-sizefrom-1.4 {usage} -returnCodes error -body {
wm sizefrom .t bad
} -result {bad argument "bad": must be program or user}
test wm-sizefrom-2.1 {setting and reading values} {
set result [list [wm sizefrom .t]]
wm sizefrom .t user
lappend result [wm sizefrom .t]
wm sizefrom .t program
lappend result [wm sizefrom .t]
wm sizefrom .t {}
lappend result [wm sizefrom .t]
} {{} user program {}}
destroy .t
### wm stackorder ###
test wm-stackorder-1.1 {usage} -returnCodes error -body {
wm stackorder
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-stackorder-1.2 {usage} -returnCodes error -body {
wm stackorder . _
} -result {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}
test wm-stackorder-1.3 {usage} -returnCodes error -body {
wm stackorder . _ _ _
} -result {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}
test wm-stackorder-1.4 {usage} -returnCodes error -body {
wm stackorder . is .
} -result {ambiguous argument "is": must be isabove or isbelow}
test wm-stackorder-1.5 {usage} -returnCodes error -body {
wm stackorder _
} -result {bad window path name "_"}
test wm-stackorder-1.6 {usage} -returnCodes error -body {
wm stackorder . isabove _
} -result {bad window path name "_"}
test wm-stackorder-1.7 {usage} -body {
toplevel .t
button .t.b
wm stackorder .t.b
} -cleanup {
destroy .t
} -returnCodes error -result {window ".t.b" isn't a top-level window}
test wm-stackorder-1.8 {usage} -body {
toplevel .t
button .t.b
pack .t.b
update
wm stackorder . isabove .t.b
} -cleanup {
destroy .t
} -returnCodes error -result {window ".t.b" isn't a top-level window}
test wm-stackorder-1.9 {usage} -body {
toplevel .t
button .t.b
pack .t.b
update
wm stackorder . isbelow .t.b
} -cleanup {
destroy .t
} -returnCodes error -result {window ".t.b" isn't a top-level window}
test wm-stackorder-1.10 {usage, isabove|isbelow toplevels must be mapped} -body {
toplevel .t
update
wm withdraw .t
wm stackorder .t isabove .
} -cleanup {
destroy .t
} -returnCodes error -result {window ".t" isn't mapped}
test wm-stackorder-1.11 {usage, isabove|isbelow toplevels must be mapped} -body {
toplevel .t
update
wm withdraw .t
wm stackorder . isbelow .t
} -cleanup {
destroy .t
} -returnCodes error -result {window ".t" isn't mapped}
deleteWindows
test wm-stackorder-2.1 {stacking order} -body {
toplevel .t ; update
raiseDelay
wm stackorder .
} -cleanup {
destroy .t
} -result {. .t}
test wm-stackorder-2.2 {stacking order} -body {
toplevel .t ; update
raise .
raiseDelay
wm stackorder .
} -cleanup {
destroy .t
} -result {.t .}
test wm-stackorder-2.3 {stacking order} -body {
toplevel .t ; update
toplevel .t2 ; update
raise .
raiseDelay
raise .t2
raiseDelay
wm stackorder .
} -cleanup {
destroy .t .t2
} -result {.t . .t2}
test wm-stackorder-2.4 {stacking order} -body {
toplevel .t ; update
toplevel .t2 ; update
raise .
lower .t2
raiseDelay
wm stackorder .
} -cleanup {
destroy .t .t2
} -result {.t2 .t .}
test wm-stackorder-2.5 {stacking order} -setup {
destroy .parent
} -body {
toplevel .parent ; update
destroy .parent.child1
toplevel .parent.child1 ; update
destroy .parent.child2
toplevel .parent.child2 ; update
destroy .extra
toplevel .extra ; update
raise .parent
lower .parent.child2
raiseDelay
wm stackorder .parent
} -cleanup {
deleteWindows
} -result {.parent.child2 .parent.child1 .parent}
test wm-stackorder-2.6 {stacking order: non-toplevel widgets ignored} -body {
toplevel .t1
raiseDelay
button .t1.b
pack .t1.b
update
wm stackorder .
} -cleanup {
destroy .t1
} -result {. .t1}
test wm-stackorder-2.7 {stacking order: no children returns self} -setup {
deleteWindows
} -body {
wm stackorder .
} -result {.}
deleteWindows
test wm-stackorder-3.1 {unmapped toplevel} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .t1 ; update
toplevel .t2 ; update
wm iconify .t1
raiseDelay
wm stackorder .
} -cleanup {
destroy .t1 .t2
} -result {. .t2}
test wm-stackorder-3.2 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t2 ; update
wm withdraw .t2
raiseDelay
wm stackorder .
} -cleanup {
destroy .t1 .t2
} -result {. .t1}
test wm-stackorder-3.3 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t2 ; update
wm withdraw .t2
wm stackorder .t2
} -cleanup {
destroy .t1 .t2
} -result {}
test wm-stackorder-3.4 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t1.t2 ; update
wm withdraw .t1.t2
wm stackorder .t1
} -cleanup {
destroy .t1
} -result {.t1}
test wm-stackorder-3.5 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t1.t2 ; update
wm withdraw .t1
wm stackorder .t1
} -cleanup {
destroy .t1
} -result {.t1.t2}
test wm-stackorder-3.6 {unmapped toplevel} -body {
toplevel .t1 ; update
toplevel .t1.t2 ; update
toplevel .t1.t2.t3 ; update
wm withdraw .t1.t2
raiseDelay
wm stackorder .t1
} -cleanup {
destroy .t1
} -result {.t1 .t1.t2.t3}
test wm-stackorder-3.7 {unmapped toplevel, mapped children returned} -body {
toplevel .t1 ; update
toplevel .t1.t2 ; update
wm withdraw .t1
wm stackorder .t1
} -cleanup {
destroy .t1
} -result {.t1.t2}
test wm-stackorder-3.8 {toplevel mapped in idle callback} -body {
toplevel .t1
wm stackorder .
} -cleanup {
destroy .t1
} -result {.}
deleteWindows
test wm-stackorder-4.1 {wm stackorder isabove|isbelow} -body {
toplevel .t ; update
raise .t
wm stackorder . isabove .t
} -cleanup {
destroy .t
} -result 0
test wm-stackorder-4.2 {wm stackorder isabove|isbelow} -body {
toplevel .t ; update
raise .t
wm stackorder . isbelow .t
} -cleanup {
destroy .t
} -result 1
test wm-stackorder-4.3 {wm stackorder isabove|isbelow} -body {
toplevel .t ; update
raise .
raiseDelay
wm stackorder .t isa .
} -cleanup {
destroy .t
} -result 0
test wm-stackorder-4.4 {wm stackorder isabove|isbelow} -body {
toplevel .t ; update
raise .
raiseDelay
wm stackorder .t isb .
} -cleanup {
destroy .t
} -result 1
deleteWindows
test wm-stackorder-5.1 {a menu is not a toplevel} -body {
toplevel .t
menu .t.m -type menubar
.t.m add cascade -label "File"
.t configure -menu .t.m
update
raise .
raiseDelay
wm stackorder .
} -cleanup {
destroy .t
} -result {.t .}
test wm-stackorder-5.2 {A normal toplevel can't be raised above an \
overrideredirect toplevel on unix} -constraints {x11 failsOnUbuntu failsOnXQuarz} -body {
toplevel .t
tkwait visibility .t
wm overrideredirect .t 1
raise .
update
raiseDelay
wm stackorder . isabove .t
} -cleanup {
destroy .t
} -result 0
test wm-stackorder-5.2.1 {A normal toplevel can be raised above an \
overrideredirect toplevel on macOS or win} -constraints aquaOrWin32 -body {
toplevel .t
tkwait visibility .t
wm overrideredirect .t 1
raise .
update
raiseDelay
wm stackorder . isabove .t
} -cleanup {
destroy .t
} -result 1
test wm-stackorder-5.3 {An overrideredirect window\
can be explicitly lowered} -constraints failsOnXQuarz -body {
toplevel .t
tkwait visibility .t
wm overrideredirect .t 1
lower .t
update
raiseDelay
wm stackorder .t isbelow .
} -cleanup {
destroy .t
} -result 1
test wm-stackorder-6.1 {An embedded toplevel does not appear in the \
stacking order} -body {
toplevel .real -container 1
raiseDelay
toplevel .embd -bg blue -use [winfo id .real]
raiseDelay
wm stackorder .
} -cleanup {
deleteWindows
} -result {. .real}
stdWindow
### wm title ###
test wm-title-1.1 {usage} -returnCodes error -body {
wm title
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-title-1.2 {usage} -returnCodes error -body {
wm title . 1 2
} -result {wrong # args: should be "wm title window ?newTitle?"}
test wm-title-2.1 {setting and reading values} -setup {
destroy .t
} -body {
toplevel .t
set result [wm title .t]
wm title .t Apa
lappend result [wm title .t]
wm title .t {}
lappend result [wm title .t]
} -result {t Apa {}}
### wm transient ###
test wm-transient-1.1 {usage} -returnCodes error -body {
catch {destroy .t} ; toplevel .t
wm transient .t 1 2
} -result {wrong # args: should be "wm transient window ?window?"}
test wm-transient-1.2 {usage} -returnCodes error -body {
catch {destroy .t} ; toplevel .t
wm transient .t foo
} -result {bad window path name "foo"}
test wm-transient-1.3 {usage} -returnCodes error -body {
catch {destroy .t} ; toplevel .t
wm transient foo .t
} -result {bad window path name "foo"}
deleteWindows
test wm-transient-1.4 {usage} -returnCodes error -body {
toplevel .top
toplevel .subject
wm transient .subject .top
wm iconify .subject
} -cleanup {
deleteWindows
} -result {can't iconify ".subject": it is a transient}
test wm-transient-1.5 {usage} -returnCodes error -body {
toplevel .icon -bg blue
toplevel .top
wm iconwindow .top .icon
toplevel .dummy
wm transient .icon .dummy
} -cleanup {
deleteWindows
} -result {can't make ".icon" a transient: it is an icon for .top}
test wm-transient-1.6 {usage} -returnCodes error -body {
toplevel .icon -bg blue
toplevel .top
wm iconwindow .top .icon
toplevel .dummy
wm transient .dummy .icon
} -cleanup {
deleteWindows
} -result {can't make ".icon" a container: it is an icon for .top}
test wm-transient-1.7 {usage} -returnCodes error -body {
toplevel .top
wm transient .top .top
} -cleanup {
deleteWindows
} -result {can't set ".top" as container: would cause management loop}
test wm-transient-1.8 {usage} -returnCodes error -body {
toplevel .t1
toplevel .t2
toplevel .t3
wm transient .t2 .t1
wm transient .t3 .t2
wm transient .t1 .t3
} -cleanup {
deleteWindows
} -result {can't set ".t3" as container: would cause management loop}
test wm-transient-1.9 {usage} -returnCodes error -body {
toplevel .top
frame .top.f
wm transient .top .top.f
} -cleanup {
deleteWindows
} -result {can't set ".top" as container: would cause management loop}
test wm-transient-2.1 {basic get/set of toplevel} -setup {
set results [list]
} -body {
toplevel .top
toplevel .subject
lappend results [wm transient .subject]
wm transient .subject .top
lappend results [wm transient .subject]
wm transient .subject {}
lappend results [wm transient .subject]
} -cleanup {
deleteWindows
} -result {{} .top {}}
test wm-transient-2.2 {first toplevel parent of non-toplevel container window is used} -body {
toplevel .top
frame .top.f
toplevel .subject
wm transient .subject .top.f
wm transient .subject
} -cleanup {
deleteWindows
} -result {.top}
test wm-transient-3.1 {transient toplevel is withdrawn
when mapped if toplevel is withdrawn} -body {
toplevel .top
wm withdraw .top
update
toplevel .subject
wm transient .subject .top
update
list [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0}
test wm-transient-3.2 {already mapped transient toplevel
takes on withdrawn state of toplevel} -body {
toplevel .top
wm withdraw .top
update
toplevel .subject
update
wm transient .subject .top
update
list [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0}
test wm-transient-3.3 {withdraw/deiconify on the toplevel
also does a withdraw/deiconify on the transient} -setup {
set results [list]
} -body {
toplevel .top
toplevel .subject
update
wm transient .subject .top
wm withdraw .top
update
lappend results [wm state .subject] [winfo ismapped .subject]
wm deiconify .top
update
lappend results [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0 normal 1}
test wm-transient-4.1 {transient toplevel is withdrawn
when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .top
wm iconify .top
update
toplevel .subject
wm transient .subject .top
update
list [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0}
test wm-transient-4.2 {already mapped transient toplevel
is withdrawn if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .top
raiseDelay
wm iconify .top
update idletasks
toplevel .subject
update idletasks
wm transient .subject .top
update idletasks
list [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0}
test wm-transient-4.3 {iconify/deiconify on the toplevel
does a withdraw/deiconify on the transient} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
set results [list]
} -body {
toplevel .top
toplevel .subject
update idletasks
wm transient .subject .top
wm iconify .top
update idletasks
lappend results [wm state .subject] [winfo ismapped .subject]
wm deiconify .top
update idletasks
lappend results [wm state .subject] [winfo ismapped .subject]
} -cleanup {
deleteWindows
} -result {withdrawn 0 normal 1}
test wm-transient-5.1 {an error during transient command should not
cause the map/unmap binding to be deleted} -setup {
set results [list]
} -body {
toplevel .top
toplevel .subject
update
wm transient .subject .top
# Expect a bad window path error here
lappend results [catch {wm transient .subject .bad}]
wm withdraw .top
update
lappend results [wm state .subject]
wm deiconify .top
update
lappend results [wm state .subject]
} -cleanup {
deleteWindows
} -result {1 withdrawn normal}
test wm-transient-5.2 {remove transient property when toplevel
is destroyed} -body {
toplevel .top
toplevel .subject
wm transient .subject .top
update
destroy .top
update
wm transient .subject
} -cleanup {
deleteWindows
} -result {}
test wm-transient-5.3 {remove transient property from window
that had never been mapped when toplevel is destroyed} -body {
toplevel .top
toplevel .subject
wm transient .subject .top
destroy .top
wm transient .subject
} -cleanup {
deleteWindows
} -result {}
test wm-transient-6.1 {a withdrawn transient does not track
state changes in the toplevel} -body {
toplevel .top
toplevel .subject
update
wm transient .subject .top
wm withdraw .subject
wm withdraw .top
wm deiconify .top
# idle handler should not map the transient
update
wm state .subject
} -cleanup {
deleteWindows
} -result {withdrawn}
test wm-transient-6.2 {a withdrawn transient does not track
state changes in the toplevel} -setup {
set results [list]
} -body {
toplevel .top
toplevel .subject
update
wm transient .subject .top
wm withdraw .subject
wm withdraw .top
wm deiconify .top
# idle handler should not map the transient
update
lappend results [wm state .subject]
wm deiconify .subject
lappend results [wm state .subject]
wm withdraw .top
lappend results [wm state .subject]
wm deiconify .top
# idle handler should map transient
update
lappend results [wm state .subject]
} -cleanup {
deleteWindows
} -result {withdrawn normal withdrawn normal}
test wm-transient-6.3 {a withdrawn transient does not track
state changes in the toplevel} -body {
toplevel .top
toplevel .subject
update
# withdraw before making window a transient
wm withdraw .subject
wm transient .subject .top
wm withdraw .top
wm deiconify .top
# idle handler should not map the transient
update
wm state .subject
} -cleanup {
deleteWindows
} -result {withdrawn}
# wm-transient-7.*: See SF Tk Bug #592201 "wm transient fails with two toplevels"
# wm-transient-7.3 through 7.5 all caused panics on Unix in Tk 8.4b1.
# 7.1 and 7.2 added to catch (potential) future errors.
#
test wm-transient-7.1 {Destroying transient} -body {
toplevel .t
toplevel .transient
wm transient .transient .t
destroy .transient
destroy .t
# OK: the above did not cause a panic.
} -cleanup {
deleteWindows
}
test wm-transient-7.2 {Destroying toplevel} -body {
toplevel .top
toplevel .transient
wm transient .transient .top
destroy .top
wm transient .transient
} -cleanup {
deleteWindows
} -result {}
test wm-transient-7.3 {Reassign transient, destroy old toplevel} -body {
toplevel .t1
toplevel .t2
toplevel .transient
wm transient .transient .t1
wm transient .transient .t2
destroy .t1 ;# Caused panic in 8.4b1
destroy .t2
destroy .transient
} -cleanup {
deleteWindows
}
test wm-transient-7.4 {Reassign transient, destroy new toplevel} -body {
toplevel .t1
toplevel .t2
toplevel .transient
wm transient .transient .t1
wm transient .transient .t2
destroy .t2 ;# caused panic in 8.4b1
destroy .t1
destroy .transient
} -cleanup {
deleteWindows
}
test wm-transient-7.5 {Reassign transient, destroy transient} -body {
toplevel .t1
toplevel .t2
toplevel .transient
wm transient .transient .t1
wm transient .transient .t2
destroy .transient
destroy .t2 ;# caused panic in 8.4b1
destroy .t1 ;# so did this
} -cleanup {
deleteWindows
}
test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
deleteWindows
set result {}
} -body {
# Verifies that transients stay on top of their toplevels, even if they were
# made transients when those toplevels were withdrawn.
toplevel .t1; wm withdraw .t1; update
toplevel .t2; wm transient .t2 .t1; update
lappend result [winfo ismapped .t1] [winfo ismapped .t2]
wm deiconify .t1; update
lappend result [winfo ismapped .t1] [winfo ismapped .t2]
raise .t1; raiseDelay; update
lappend result [lsearch -all -inline -glob [wm stackorder .] ".t?"]
} -cleanup {
deleteWindows
} -result {0 0 1 1 {.t1 .t2}}
### wm state ###
test wm-state-1.1 {usage} -returnCodes error -body {
wm state
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-state-1.2 {usage} -returnCodes error -body {
wm state . _ _
} -result {wrong # args: should be "wm state window ?state?"}
deleteWindows
test wm-state-2.1 {initial state} -body {
toplevel .t
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.2 {state change before map} -body {
toplevel .t
wm state .t withdrawn
wm state .t
} -cleanup {
deleteWindows
} -result {withdrawn}
test wm-state-2.3 {state change before map} -body {
toplevel .t
wm withdraw .t
wm state .t
} -cleanup {
deleteWindows
} -result {withdrawn}
test wm-state-2.4 {state change after map} -body {
toplevel .t
update
wm state .t withdrawn
wm state .t
} -cleanup {
deleteWindows
} -result {withdrawn}
test wm-state-2.5 {state change after map} -body {
toplevel .t
update
wm withdraw .t
wm state .t
} -cleanup {
deleteWindows
} -result {withdrawn}
test wm-state-2.6 {state change before map} -body {
toplevel .t
wm state .t iconic
wm state .t
} -cleanup {
deleteWindows
} -result {iconic}
test wm-state-2.7 {state change before map} -body {
toplevel .t
wm iconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {iconic}
test wm-state-2.8 {state change after map} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .t
update
wm state .t iconic
wm state .t
} -cleanup {
deleteWindows
} -result {iconic}
test wm-state-2.9 {state change after map} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .t
update
wm iconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {iconic}
test wm-state-2.10 {state change before map} -body {
toplevel .t
wm withdraw .t
wm state .t normal
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.11 {state change before map} -body {
toplevel .t
wm withdraw .t
wm deiconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.12 {state change after map} -body {
toplevel .t
update
wm withdraw .t
wm state .t normal
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.13 {state change after map} -body {
toplevel .t
update
wm withdraw .t
wm deiconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.14 {state change before map} -body {
toplevel .t
wm iconify .t
wm state .t normal
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.15 {state change before map} -body {
toplevel .t
wm iconify .t
wm deiconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.16 {state change after map} -body {
toplevel .t
update
wm iconify .t
wm state .t normal
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.17 {state change after map} -body {
toplevel .t
update
wm iconify .t
wm deiconify .t
wm state .t
} -cleanup {
deleteWindows
} -result {normal}
test wm-state-2.18 {state change after map} -constraints win -body {
toplevel .t
update
wm state .t zoomed
wm state .t
} -cleanup {
deleteWindows
} -result {zoomed}
### wm withdraw ###
test wm-withdraw-1.1 {usage} -returnCodes error -body {
wm withdraw
} -result {wrong # args: should be "wm option window ?arg ...?"}
test wm-withdraw-1.2 {usage} -returnCodes error -body {
wm withdraw . _
} -result {wrong # args: should be "wm withdraw window"}
deleteWindows
test wm-withdraw-2.1 {Misc errors} -body {
toplevel .t
toplevel .t2
wm iconwindow .t .t2
wm withdraw .t2
} -returnCodes error -cleanup {
deleteWindows
} -result {can't withdraw .t2: it is an icon for .t}
test wm-withdraw-3.1 {} -setup {
set result {}
} -body {
toplevel .t
update
wm withdraw .t
lappend result [wm state .t] [winfo ismapped .t]
wm deiconify .t
lappend result [wm state .t] [winfo ismapped .t]
} -cleanup {
deleteWindows
} -result {withdrawn 0 normal 1}
### Misc. wm tests ###
test wm-deletion-epoch-1.1 {Deletion epoch on multiple displays} -constraints altDisplay -body {
# See Tk Bug #671330 "segfault when e.g. deiconifying destroyed window"
set w [toplevel .t -screen $env(TK_ALT_DISPLAY)]
wm deiconify $w ;# this caches the WindowRep
destroy .t
wm deiconify $w
} -returnCodes error -result {bad window path name ".t"} -cleanup {
deleteWindows
}
### Docking test (manage, forget) ###
test wm-manage-1.1 {managing a frame} -setup {
set result [list]
} -body {
toplevel .t
frame .t.f
pack [label .t.f.l -text hello]
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -result {wm .t.f}
test wm-manage-1.2 {managing a toplevel} -setup {
set result [list]
} -body {
toplevel .t
pack [label .t.l -text hello]
wm manage .t
raise .t
update
lappend result [winfo manage .t]
lappend result [winfo toplevel .t]
} -cleanup {
deleteWindows
} -result {wm .t}
test wm-manage-1.3 {managing a labelframe} -setup {
set result [list]
} -body {
toplevel .t
labelframe .t.f -text Labelframe
pack [label .t.f.l -text hello]
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -result {wm .t.f}
test wm-manage-1.4 {managing a ttk::frame} -setup {
set result [list]
} -body {
toplevel .t
ttk::frame .t.f
pack [label .t.f.l -text hello]
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
test wm-manage-1.5 {managing a text widget} -setup {
set result [list]
} -body {
toplevel .t
text .t.f
.t.f insert end "Manage text\n" {}
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
test wm-manage-1.6 {managing a button} -setup {
set result [list]
} -body {
toplevel .t
button .t.f -text Button
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -returnCodes error -result "window \".t.f\" is not manageable: must be a frame, labelframe or toplevel"
test wm-manage-1.7 {managing a frame} -setup {
set result [list]
} -body {
toplevel .t
frame .t.f
pack [label .t.f.l -text Label]
pack .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
wm manage .t.f
raise .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
wm forget .t.f
pack .t.f
update
lappend result [winfo manage .t.f]
lappend result [winfo toplevel .t.f]
} -cleanup {
deleteWindows
} -result {pack .t wm .t.f pack .t}
test wm-manage-1.8 {unmanaging a toplevel} -setup {
set result [list]
} -body {
toplevel .t
toplevel .t.t
button .t.t.b -text "Manage This"
pack .t.t.b
update
lappend result [winfo manage .t.t]
lappend result [winfo toplevel .t.t.b]
wm forget .t.t
wm forget .t.t ; # second call should be a no-op
pack .t.t
update
lappend result [winfo manage .t.t]
lappend result [winfo toplevel .t.t.b]
wm manage .t.t
wm manage .t.t ; # second call should be a no-op
wm deiconify .t.t
update
lappend result [winfo manage .t.t]
lappend result [winfo toplevel .t.t.b]
} -cleanup {
deleteWindows
} -result {wm .t.t pack .t wm .t.t}
test wm-forget-1.1 "bug #2009788: forget toplevel can cause crash" -body {
toplevel .parent
toplevel .parent.child
wm forget .parent.child
winfo exists .parent.child
} -cleanup {
deleteWindows
} -result 1
test wm-forget-1.2 "bug #2009788: forget toplevel can cause crash" -body {
toplevel .parent
update
toplevel .parent.child
wm forget .parent.child
winfo exists .parent.child
} -cleanup {
deleteWindows
} -result 1
test wm-forget-1.3 "bug #2009788: forget toplevel can cause crash" -body {
toplevel .parent
toplevel .parent.child
wm forget .parent.child
wm manage .parent.child
winfo exists .parent.child
} -cleanup {
deleteWindows
} -result 1
test wm-forget-1.4 "pack into unmapped toplevel causes crash" -body {
toplevel .parent
toplevel .parent.child
wm forget .parent.child
pack [button .parent.child.button -text Hello]
after 250 {destroy .parent}
tkwait window .parent
} -cleanup {
deleteWindows
} -result {}
test wm-forget-2 {bug [e9112ef96e] - [wm forget] doesn't completely} -setup {
catch {destroy .l .f.b .f}
set res {}
} -body {
label .l -text "Top Dot"
frame .f
button .f.b -text Hello -command "puts Hello!"
pack .l -side top
pack .f.b
pack .f -side bottom
set res [winfo manager .f]
pack forget .f
update
lappend res [winfo manager .f]
wm manage .f
update
lappend res [winfo manager .f]
wm forget .f
update
lappend res [winfo manager .f]
} -cleanup {
destroy .l .f.b .f
unset res
} -result {pack {} wm {}}
# FIXME:
# Test delivery of virtual events to the WM. We could check to see if the
# window was raised after a button click for example. This sort of testing may
# not be possible.
##############################################################################
deleteWindows
cleanupTests
catch {unset results}
catch {unset focusin}
return
# Local variables:
# mode: tcl
# End:
|