/usr/share/doc/libxaw7-dev/libXaw.html is in libxaw-doc 2:1.0.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Athena Widget Set - C Language Interface</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><style xmlns="" type="text/css">/*
* Copyright (c) 2011 Gaetan Nadon
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*
* Shared stylesheet for X.Org documentation translated to HTML format
* http://www.sagehill.net/docbookxsl/UsingCSS.html
* http://www.w3schools.com/css/default.asp
* https://addons.mozilla.org/en-US/firefox/addon/web-developer/developers
* https://addons.mozilla.org/en-US/firefox/addon/font-finder/
*/
/*
* The sans-serif fonts are considered more legible on a computer screen
* http://dry.sailingissues.com/linux-equivalents-verdana-arial.html
*
*/
body {
font-family: "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif;
/* In support of using "em" font size unit, the w3c recommended method */
font-size: 100%;
}
/*
* Selection: all elements requiring mono spaced fonts.
*
* The family names attempt to match the proportionally spaced font
* family names such that the same font name is used for both.
* We'd like to use Bitstream, for example, in both proportionally and
* mono spaced font text.
*/
.command,
.errorcode,
.errorname,
.errortype,
.filename,
.funcsynopsis,
.function,
.parameter,
.programlisting,
.property,
.screen,
.structname,
.symbol,
.synopsis,
.type
{
font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Courier, "Liberation Mono", Monospace;
}
/*
* Books have a title page, a preface, some chapters and appendices,
* a glossary, an index and a bibliography, in that order.
*
* An Article has no preface and no chapters. It has sections, appendices,
* a glossary, an index and a bibliography.
*/
/*
* Selection: book main title and subtitle
*/
div.book>div.titlepage h1.title,
div.book>div.titlepage h2.subtitle {
text-align: center;
}
/*
* Selection: article main title and subtitle
*/
div.article>div.titlepage h2.title,
div.article>div.titlepage h3.subtitle,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title {
text-align: center;
}
/*
* Selection: various types of authors and collaborators, individuals or corporate
*
* These authors are not always contained inside an authorgroup.
* They can be contained inside a lot of different parent types where they might
* not be centered.
* Reducing the margin at the bottom makes a visual separation between authors
* We specify here the ones on the title page, others may be added based on merit.
*/
div.titlepage .authorgroup,
div.titlepage .author,
div.titlepage .collab,
div.titlepage .corpauthor,
div.titlepage .corpcredit,
div.titlepage .editor,
div.titlepage .othercredit {
text-align: center;
margin-bottom: 0.25em;
}
/*
* Selection: the affiliation of various types of authors and collaborators,
* individuals or corporate.
*/
div.titlepage .affiliation {
text-align: center;
}
/*
* Selection: product release information (X Version 11, Release 7)
*
* The releaseinfo element can be contained inside a lot of different parent
* types where it might not be centered.
* We specify here the one on the title page, others may be added based on merit.
*/
div.titlepage p.releaseinfo {
font-weight: bold;
text-align: center;
}
/*
* Selection: publishing date
*/
div.titlepage .pubdate {
text-align: center;
}
/*
* The legal notices are displayed in smaller sized fonts
* Justification is only supported in IE and therefore not requested.
*
*/
.legalnotice {
font-size: small;
font-style: italic;
}
/*
* For documentation having multiple licenses, the copyright and legalnotice
* elements sequence cannot instantiated multiple times.
* The copyright notice and license text are therefore coded inside a legalnotice
* element. The role attribute on the paragraph is used to allow styling of the
* copyright notice text which should not be italicized.
*/
p.multiLicensing {
font-style: normal;
font-size: medium;
}
/*
* Selection: book or article main ToC title
* A paragraph is generated for the title rather than a level 2 heading.
* We do not want to select chapters sub table of contents, only the main one
*/
div.book>div.toc>p,
div.article>div.toc>p {
font-size: 1.5em;
text-align: center;
}
/*
* Selection: major sections of a book or an article
*
* Unlike books, articles do not have a titlepage element for appendix.
* Using the selector "div.titlepage h2.title" would be too general.
*/
div.book>div.preface>div.titlepage h2.title,
div.book>div.chapter>div.titlepage h2.title,
div.article>div.sect1>div.titlepage h2.title,
div.article>div.section>div.titlepage h2.title,
div.book>div.appendix>div.titlepage h2.title,
div.article>div.appendix h2.title,
div.glossary>div.titlepage h2.title,
div.index>div.titlepage h2.title,
div.bibliography>div.titlepage h2.title {
/* Add a border top over the major parts, just like printed books */
/* The Gray color is already used for the ruler over the main ToC. */
border-top-style: solid;
border-top-width: 2px;
border-top-color: Gray;
/* Put some space between the border and the title */
padding-top: 0.2em;
text-align: center;
}
/*
* A Screen is a verbatim environment for displaying text that the user might
* see on a computer terminal. It is often used to display the results of a command.
*
* http://www.css3.info/preview/rounded-border/
*/
.screen {
background: #e0ffff;
border-width: 1px;
border-style: solid;
border-color: #B0C4DE;
border-radius: 1.0em;
/* Browser's vendor properties prior to CSS 3 */
-moz-border-radius: 1.0em;
-webkit-border-radius: 1.0em;
-khtml-border-radius: 1.0em;
margin-left: 1.0em;
margin-right: 1.0em;
padding: 0.5em;
}
/*
* Emphasis program listings with a light shade of gray similar to what
* DocBook XSL guide does: http://www.sagehill.net/docbookxsl/ProgramListings.html
* Found many C API docs on the web using like shades of gray.
*/
.programlisting {
background: #F4F4F4;
border-width: 1px;
border-style: solid;
border-color: Gray;
padding: 0.5em;
}
/*
* Emphasis functions synopsis using a darker shade of gray.
* Add a border such that it stands out more.
* Set the padding so the text does not touch the border.
*/
.funcsynopsis, .synopsis {
background: #e6e6fa;
border-width: 1px;
border-style: solid;
border-color: Gray;
clear: both;
margin: 0.5em;
padding: 0.25em;
}
/*
* Selection: paragraphs inside synopsis
*
* Removes the default browser margin, let the container set the padding.
* Paragraphs are not always used in synopsis
*/
.funcsynopsis p,
.synopsis p {
margin: 0;
padding: 0;
}
/*
* Selection: variable lists, informal tables and tables
*
* Note the parameter name "variablelist.as.table" in xorg-xhtml.xsl
* A table with rows and columns is constructed inside div.variablelist
*
* Set the left margin so it is indented to the right
* Display informal tables with single line borders
*/
table {
margin-left: 0.5em;
border-collapse: collapse;
}
/*
* Selection: paragraphs inside tables
*
* Removes the default browser margin, let the container set the padding.
* Paragraphs are not always used in tables
*/
td p {
margin: 0;
padding: 0;
}
/*
* Add some space between the left and right column.
* The vertical alignment helps the reader associate a term
* with a multi-line definition.
*/
td, th {
padding-left: 1.0em;
padding-right: 1.0em;
vertical-align: top;
}
.warning {
border: 1px solid red;
background: #FFFF66;
padding-left: 0.5em;
}
</style></head><body><div class="book"><div class="titlepage"><div><div><h1 class="title"><a id="libXaw"></a>Athena Widget Set - C Language Interface</h1></div><div><h2 class="subtitle">X Consortium Standard</h2></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Chris</span> <span class="othername">D.</span> <span class="surname">Peterson</span></h3><div class="affiliation"><span class="orgname">formerly MIT X Consortium<br /></span></div></div></div></div><div><p class="releaseinfo">X Version 11, Release 7.7</p></div><div><p class="copyright">Copyright © 1985, 1986, 1987, 1988, 1989, 1991, 1994 X Consortium</p></div><div><div class="legalnotice"><a id="idp50658816"></a><p>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files
(the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following
conditions:
</p><p>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</p><p>
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</p><p>
Except as contained in this notice, the name of the X Consortium shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
</p><p>X Window System is a trademark of The OpenGroup.</p></div></div><div><div class="legalnotice"><a id="idp52144736"></a><p class="multiLicensing">Copyright © 1985, 1986, 1987, 1988, 1989, 1991
Digital Equipment Corporation, Maynard, Massachusetts.
</p><p>
Permission to use, copy, modify and distribute this documentation for any
purpose and without fee is hereby granted, provided that the above copyright
notice appears in all copies and that both that copyright notice and this
permission notice appear in supporting documentation, and that the name of
Digital not be used in in advertising or publicity pertaining
to distribution of the software without specific, written prior permission.
Digital makes no representations about the suitability of the
software described herein for any purpose.
It is provided “as is” without express or implied warranty.
</p></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="#Athena_Widgets_and_The_Intrinsics">1. Athena Widgets and The Intrinsics</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Introduction_to_the_X_Toolkit">Introduction to the X Toolkit</a></span></dt><dt><span class="sect1"><a href="#Terminology">Terminology</a></span></dt><dt><span class="sect1"><a href="#Underlying_Model">Underlying Model</a></span></dt><dt><span class="sect1"><a href="#Conventions_Used_in_this_Manual">Conventions Used in this Manual</a></span></dt><dt><span class="sect1"><a href="#Format_of_the_Widget_Reference_Chapters">Format of the Widget Reference Chapters</a></span></dt><dt><span class="sect1"><a href="#Input_Focus">Input Focus</a></span></dt></dl></dd><dt><span class="chapter"><a href="#idp51077360">2. Using Widgets</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Using_Widgets">Using Widgets</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Setting_the_Locale">Setting the Locale</a></span></dt><dt><span class="sect2"><a href="#Initializing_the_Toolkit">Initializing the Toolkit</a></span></dt><dt><span class="sect2"><a href="#Creating_a_Widget">Creating a Widget</a></span></dt><dt><span class="sect2"><a href="#Common_Resources">Common Resources</a></span></dt><dt><span class="sect2"><a href="#Resource_Conversions">Resource Conversions</a></span></dt><dt><span class="sect2"><a href="#Realizing_a_Widget">Realizing a Widget</a></span></dt><dt><span class="sect2"><a href="#Processing_Events">Processing Events</a></span></dt><dt><span class="sect2"><a href="#Standard_Widget_Manipulation_Functions">Standard Widget Manipulation Functions</a></span></dt><dt><span class="sect2"><a href="#Using_the_Client_Callback_Interface">Using the Client Callback Interface</a></span></dt><dt><span class="sect2"><a href="#Programming_Considerations">Programming Considerations</a></span></dt><dt><span class="sect2"><a href="#Example_Programs">Example Programs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Simple_Widgets">3. Simple Widgets</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Command_Widget">Command Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Command_Actions">Command Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Grip_Widget">Grip Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Grip::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Grip_Actions">Grip Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Label_Widget">Label Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Label::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#List_Widget">List Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#List::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#List_Actions">List Actions</a></span></dt><dt><span class="sect2"><a href="#List_Callbacks">List Callbacks</a></span></dt><dt><span class="sect2"><a href="#Changing_the_List">Changing the List</a></span></dt><dt><span class="sect2"><a href="#Highlighting_an_Item">Highlighting an Item</a></span></dt><dt><span class="sect2"><a href="#Unhighlighting_an_Item">Unhighlighting an Item</a></span></dt><dt><span class="sect2"><a href="#Retrieving_the_Currently_Selected_Item">Retrieving the Currently Selected Item</a></span></dt><dt><span class="sect2"><a href="#Restrictions">Restrictions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Panner_Widget">Panner Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Panner::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Panner_Actions">Panner Actions</a></span></dt><dt><span class="sect2"><a href="#Panner_Callbacks">Panner Callbacks</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Repeater_Widget">Repeater Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Repeater::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Repeater_Actions">Repeater Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Scrollbar_Widget">Scrollbar Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Scrollbar::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Scrollbar_Actions">Scrollbar Actions</a></span></dt><dt><span class="sect2"><a href="#Scrollbar_Callbacks">Scrollbar Callbacks</a></span></dt><dt><span class="sect2"><a href="#Convenience_Routines">Convenience Routines</a></span></dt><dt><span class="sect2"><a href="#Setting_Float_Resources">Setting Float Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Simple_Widget">Simple Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Simple::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#StripChart_Widget">StripChart Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#StripChart::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Getting_the_StripChart_Value">Getting the StripChart Value</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Toggle_Widget">Toggle Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Toggle::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Toggle_Actions">Toggle Actions</a></span></dt><dt><span class="sect2"><a href="#Toggle_Actions_b">Toggle Actions</a></span></dt><dt><span class="sect2"><a href="#Radio_Groups">Radio Groups</a></span></dt><dt><span class="sect2"><a href="#Toggle::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Menus">4. Menus</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Using_the_Menus">Using the Menus</a></span></dt><dt><span class="sect1"><a href="#Sme_Object">Sme Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Sme::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_Sme_Object">Subclassing the Sme Object</a></span></dt></dl></dd><dt><span class="sect1"><a href="#SmeBSB_Object">SmeBSB Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#SmeBSB::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#SmeLine_Object">SmeLine Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#SmeLine::Resources">Resources</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Text_Widgets">5. Text Widgets</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Text_Widget_for_Users">Text Widget for Users</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Default_Key_Bindings">Default Key Bindings</a></span></dt><dt><span class="sect2"><a href="#Search_and_Replace">Search and Replace</a></span></dt><dt><span class="sect2"><a href="#File_Insertion">File Insertion</a></span></dt><dt><span class="sect2"><a href="#Text_Selections_for_Users">Text Selections for Users</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Text_Widget_Actions">Text Widget Actions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Cursor_Movement_Actions">Cursor Movement Actions\fP</a></span></dt><dt><span class="sect2"><a href="#Delete_Actions">Delete Actions</a></span></dt><dt><span class="sect2"><a href="#Selection_Actions">Selection Actions</a></span></dt><dt><span class="sect2"><a href="#The_New_Line_Actions">The New Line Actions</a></span></dt><dt><span class="sect2"><a href="#Kill_and_Actions">Kill and Actions</a></span></dt><dt><span class="sect2"><a href="#Miscellaneous_Actions">Miscellaneous Actions</a></span></dt><dt><span class="sect2"><a href="#Text_Selections_for_Application_Programmers">Text Selections for Application Programmers</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Default_Translation_Bindings">Default Translation Bindings</a></span></dt><dt><span class="sect1"><a href="#Text_Functions">Text Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Selecting_Text">Selecting Text</a></span></dt><dt><span class="sect2"><a href="#Unhighlighting_Text">Unhighlighting Text</a></span></dt><dt><span class="sect2"><a href="#Getting_Current_Text_Selection">Getting Current Text Selection</a></span></dt><dt><span class="sect2"><a href="#Replacing_Text">Replacing Text</a></span></dt><dt><span class="sect2"><a href="#Searching_for_Text">Searching for Text</a></span></dt><dt><span class="sect2"><a href="#Redisplaying_Text">Redisplaying Text</a></span></dt><dt><span class="sect2"><a href="#Resources_Convenience_Routines">Resources Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Customizing_the_Text_Widget">Customizing the Text Widget</a></span></dt><dt><span class="sect1"><a href="#Text_Widget">Text Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Text::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#TextSink_Object">TextSink Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#TextSink::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_TextSink">Subclassing the TextSink</a></span></dt></dl></dd><dt><span class="sect1"><a href="#TextSrc_Object">TextSrc Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#TextSource::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_TextSrc">Subclassing the TextSrc</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Sink_Object_and_Multi_Sink_Object">Ascii Sink Object and Multi Sink Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiSink::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Source_Object_and_Multi_Source_Object">Ascii Source Object and Multi Source Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiSource::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#AsciiSource::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Text_Widget">Ascii Text Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiText::Resources">Resources</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Composite_and_Constraint_Widgets">6. Composite and Constraint Widgets</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Box_Widget">Box Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Box::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Layout_Semantics">Layout Semantics</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Dialog_Widget">Dialog Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Dialog::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Dialog::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Automatically_Created_Children">Automatically Created Children.</a></span></dt><dt><span class="sect2"><a href="#Dialog::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Form_Widget">Form Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Form::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Form::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Form::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Form::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Paned_Widget">Paned Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Using_the_Paned_Widget">Using the Paned Widget</a></span></dt><dt><span class="sect2"><a href="#Paned::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Paned::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Paned::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Grip_Translations">Grip Translations</a></span></dt><dt><span class="sect2"><a href="#Paned::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Porthole_Widget">Porthole Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Porthole::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Porthole::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Porthole_Callbacks">Porthole Callbacks</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Tree_Widget">Tree Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Tree::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Tree::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Tree::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Tree::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Viewport_Widget">Viewport Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Viewport::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Viewport::Layout_Semantics">Layout Semantics</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#Creating_New_Widgets_Subclassing">7. Creating New Widgets (Subclassing)</a></span></dt><dd><dl><dt><span class="sect1"><a href="#Public_Header_File">Public Header File</a></span></dt><dt><span class="sect1"><a href="#Private_Header_File">Private Header File</a></span></dt><dt><span class="sect1"><a href="#Widget_Source_File">Widget Source File</a></span></dt></dl></dd><dt><span class="chapter"><a href="#idp49380912">8. Acknowledgments</a></span></dt></dl></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Athena_Widgets_and_The_Intrinsics"></a>Chapter 1. Athena Widgets and The Intrinsics</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Introduction_to_the_X_Toolkit">Introduction to the X Toolkit</a></span></dt><dt><span class="sect1"><a href="#Terminology">Terminology</a></span></dt><dt><span class="sect1"><a href="#Underlying_Model">Underlying Model</a></span></dt><dt><span class="sect1"><a href="#Conventions_Used_in_this_Manual">Conventions Used in this Manual</a></span></dt><dt><span class="sect1"><a href="#Format_of_the_Widget_Reference_Chapters">Format of the Widget Reference Chapters</a></span></dt><dt><span class="sect1"><a href="#Input_Focus">Input Focus</a></span></dt></dl></div><p>
The X Toolkit is made up of two distinct pieces, the Xt Intrinsics and a
widget set. The Athena widget set is a sample implementation of a
widget set built upon the Intrinsics. In the X Toolkit, a widget is the
combination of an X window or subwindow and its associated input and
output semantics.
</p><p>
Because the Intrinsics provide the same basic functionality to all widget
sets it may be possible to use widgets from the Athena widget set with
other widget sets based upon the Intrinsics. Since widget sets may also
implement private protocols, all functionality may not be available when
mixing and matching widget sets. For information about the Intrinsics, see
the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p><p>
The Athena widget set is a library package layered on top of the Intrinsics
and Xlib that provides a set of user interface tools sufficient to build
a wide variety of applications. This layer extends the basic
abstractions provided by X and provides the next layer of functionality
primarily by supplying a cohesive set of sample widgets. Although the
Intrinsics are a Consortium standard, there is no standard widget set.
</p><p>
To the extent possible, the Intrinsics are "policy-free". The application
environment and widget set, not the Intrinsics, define, implement, and
enforce:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Policy</p></li><li class="listitem"><p>Consistency</p></li><li class="listitem"><p>Style</p></li></ul></div><p>
Each individual widget implementation defines its own policy. The X Toolkit
design allows for, but does not necessarily encourage, the free mixing
of radically differing widget implementations.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Introduction_to_the_X_Toolkit"></a>Introduction to the X Toolkit</h2></div></div></div><p>
The X Toolkit provides tools that simplify the design of
application user interfaces in the X Window System programming environment.
It assists application programmers by providing a set of common
underlying user-interface functions. It also lets widget programmers
modify existing widgets, by subclassing, or add new widgets. By using
the X Toolkit in their applications, programmers can present a similar
user interface across applications to all workstation users.
</p><p>
The X Toolkit consists of:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A set of Intrinsics functions for building widgets
</p></li><li class="listitem"><p>
An architectural model for constructing widgets
</p></li><li class="listitem"><p>
A widget set for application programming
</p></li></ul></div><p>
While the majority of the Intrinsics functions are intended
for the widget programmer,
a subset of the Intrinsics functions are to be used by application programmers
(see <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>).
The architectural model lets the widget programmer design new widgets
by using the Intrinsics and by combining other widgets.
The application interface layers built on top of the X Toolkit include a
coordinated set of widgets and composition policies.
Some of these widgets and policies are specific to a single
application domain, and others are common to a variety of
applications.
</p><p>
The remainder of this chapter discusses the X Toolkit and Athena widget set:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Terminology
</p></li><li class="listitem"><p>
Model
</p></li><li class="listitem"><p>
Conventions used in this manual
</p></li><li class="listitem"><p>
Format of the Widget Reference Chapters
</p></li></ul></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Terminology"></a>Terminology</h2></div></div></div><p>
</p><p>
In addition to the terms already defined for X programming (see
<span class="emphasis"><em>Xlib - C Language Interface</em></span>),
the following terms are specific to the Intrinsics and Athena widget set
and used throughout this document.
</p><p>
<code class="function">Application programmer</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A programmer who uses the X Toolkit to produce an application user interface.
</p></li></ul></div><p>
<code class="function">Child</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A widget that is contained within another "parent" widget.
</p></li></ul></div><p>
<code class="function">Class</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
The general group to which a specific object belongs.
</p></li></ul></div><p>
<code class="function">Client</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A function that uses a widget in an application or for composing
other widgets.
</p></li></ul></div><p>
<code class="function">FullName</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
The name of a widget instance appended to the full name of its parent.
</p></li></ul></div><p>
<code class="function">Instance</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A specific widget object as opposed to a general widget class.
</p></li></ul></div><p>
<code class="function">Method</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A function or procedure implemented by a widget class.
</p></li></ul></div><p>
<code class="function">Name</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
The name that is specific to an instance of a widget for a given client.
This name is specified at creation time and cannot be modified.
</p></li></ul></div><p>
<code class="function">Object</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A data abstraction consisting of private data and private and public
functions that operate on the private data.
Users of the abstraction can interact with the object only through calls
to the object's public functions.
In the X Toolkit,
some of the object's public functions are called directly by the application,
while others are called indirectly when the application calls the common
Intrinsics functions.
In general, if a function is common to all widgets,
an application uses a single Intrinsics function to invoke the function for all
types of widgets.
If a function is unique to a single widget type,
the widget exports the function.
</p></li></ul></div><p>
<code class="function">Parent</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A widget that contains at least one other ("child") widget.
A parent widget is also known as a composite widget.
</p></li></ul></div><p>
<code class="function">Resource</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A named piece of data in a widget that can be set by a client,
by an application, or by user defaults.
</p></li></ul></div><p>
<code class="function">Superclass</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A larger class of which a specific class is a member.
All members of a class are also members of the superclass.
</p></li></ul></div><p>
<code class="function">User</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A person interacting with a workstation.
</p></li></ul></div><p>
<code class="function">Widget</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
An object providing a user-interface abstraction (for example, a Scrollbar
widget).
</p></li></ul></div><p>
<code class="function">Widget class</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
The general group to which a specific widget belongs,
otherwise known as the type of the widget.
</p></li></ul></div><p>
<code class="function">Widget programmer</code>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A programmer who adds new widgets to the X Toolkit.
</p></li></ul></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Underlying_Model"></a>Underlying Model</h2></div></div></div><p>
The underlying architectural model is based on the following premises:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
</p></li><li class="listitem"><p>
Every user-interface widget is associated with an X window.
The X window ID for a widget is readily available from the widget.
Standard Xlib calls can be used by widgets for many of their input and
output operations.
</p></li><li class="listitem"><p>
</p></li><li class="listitem"><p>
The data for every widget is private to the widget and its subclasses.
That is, the data is neither directly accessible
nor visible outside of the module implementing the widget.
All program interaction with the widget is performed by a set of operations
(methods) that are defined for the widget.
</p></li><li class="listitem"><p>
</p></li><li class="listitem"><p>
Widget semantics are clearly separated from widget layout geometry.
Widgets are concerned with implementing specific user-interface
semantics. They have little control over issues such as their size or
placement relative to other widget peers. Mechanisms are provided for
associating geometric managers with widgets and for widgets to make
suggestions about their own geometry.
</p></li></ul></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Conventions_Used_in_this_Manual"></a>Conventions Used in this Manual</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
All resources available to the widgets are listed with each widget. Many
of these are available to more than one widget class due to the object
oriented nature of the Intrinsics. The new resources for each widget are
listed in bold text, and the inherited resources are listed in plain text.
</p></li><li class="listitem"><p>
Global symbols are printed in <code class="function">bold</code> and can be function names,
symbols defined in include files, or structure names. Arguments are
printed in <span class="emphasis"><em>italics</em></span>.
</p></li><li class="listitem"><p>
Each function is introduced by a general discussion that distinguishes
it from other functions. The function declaration itself follows, and
each argument is specifically explained. General discussion of the
function, if any is required, follows the arguments. Where
applicable, the last paragraph of the explanation lists the return values
of the function.
</p></li><li class="listitem"><p>
To eliminate any ambiguity between those arguments that you pass and
those that a function returns to you, the explanations for all
arguments that you pass start with the word <span class="emphasis"><em>specifies</em></span> or, in the
case of multiple arguments, the word <span class="emphasis"><em>specify</em></span>. The explanations
for all arguments that are returned to you start with the word
<span class="emphasis"><em>returns</em></span> or, in the case of multiple arguments, the word
<span class="emphasis"><em>return</em></span>. The explanations for all arguments that you can pass
and are returned start with the words <span class="emphasis"><em>specifies and returns</em></span>.
</p></li><li class="listitem"><p>
Any pointer to a structure that is used to return a value is
designated as such by the <span class="emphasis"><em>_return</em></span> suffix as part of its name.
All other pointers passed to these functions are used for reading
only. A few arguments use pointers to structures that are used for
both input and output and are indicated by using the <span class="emphasis"><em>_in_out</em></span>
suffix.
</p></li></ul></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Format_of_the_Widget_Reference_Chapters"></a>Format of the Widget Reference Chapters</h2></div></div></div><p>
The majority of this document is a reference guide for the Athena
widget set. Chapters three through six give the programmer all
information necessary to use the widgets. The layout of the chapters
follows a specific pattern to allow the programmer to easily find the
desired information.
</p><p>
The first few pages of every chapter give an overview of the widgets
in that section. Widgets are grouped into chapters by functionality.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
"Chapter
</span></p></td><td><p>
Simple Widgets
</p></td></tr><tr><td><p><span class="term">
"Chapter
</span></p></td><td><p>
Menus
</p></td></tr><tr><td><p><span class="term">
"Chapter
</span></p></td><td><p>
Text Widgets
</p></td></tr><tr><td><p><span class="term">
"Chapter
</span></p></td><td><p>
Composite and Constraint Widget
</p></td></tr></tbody></table></div><p>
</p><p>
Following the introduction will be a description of each widget in that
chapter. When no functional grouping is obvious the widgets are listed
in alphabetical order, such as in chapters three and six.
</p><p>
The first section of each widget's description is a table that
contains general information about this widget class. Here is the
table for the Box widget, and an explanation of all the entries.
</p><pre class="literallayout">
Application Header file <X11/Xaw/Box.h>
Class Header file <X11/Xaw/BoxP.h>
Class boxWidgetClass
Class Name Box
Superclass Composite
</pre><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Application Header File</code>
</span></p></td><td><p>
This file must be included when an application uses this widget.
It usually contains the class definition, and some resource macros.
This is often called the ``public'' header file.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Class Header File</code>
</span></p></td><td><p>
This file will only be used by widget programmers. It will need to be
included by any widget that subclasses this widget. This is often
called the ``private'' header file.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Class</code>
</span></p></td><td><p>
This is the widget class of this widget. This global symbol is passed to
<code class="function">XtCreateWidget</code> so that the Intrinsics will know which type of widget
to create.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Class Name</code>
</span></p></td><td><p>
This is the resource name of this class. This name can be used in
a resource file to match any widget of this class.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Superclass</code>
</span></p></td><td><p>
This is the superclass that this widget class is descended from. If
you understand how the superclass works it will allow you to more quickly
understand what this widget does, since much of its functionality may be
inherited from its superclass.
</p></td></tr></tbody></table></div><p>
</p><p>
After this table follows a general description of the default behavior of
this widget, as seen by the user. In many cases this functionality
may be overridden by the application programmer, or by the user.
</p><p>
The next section is a table showing the
name, class, type and default value of each resource that is available
to this widget. There is also a column containing notes describing
special restrictions placed upon individual resources.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
A
</span></p></td><td><p>
This resource may be automatically adjusted when another
resource is changed.
</p></td></tr><tr><td><p><span class="term">
C
</span></p></td><td><p>
This resource is only settable at widget creation time, and may not
be modified with <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>.
</p></td></tr><tr><td><p><span class="term">
D
</span></p></td><td><p>
Do not modify this resource. While setting this resource will
work, it can cause unexpected behavior. When this symbol appears
there is another, preferred, interface provided by the X Toolkit.
</p></td></tr><tr><td><p><span class="term">
R
</span></p></td><td><p>
This resource is READ-ONLY, and may not be modified.
</p></td></tr></tbody></table></div><p>
</p><p>
After the resource table is a detailed description of every resource
available to that widget. Many of these are redundant, but printing
them with each widget saves page flipping. The names of the resources
that are inherited are printed in plain text, while the names of the
resources that are new to this class are printed in <code class="function">bold</code>.
If you have already read the description of the superclass you need
only pay attention to the resources printed in bold.
</p><p>
For each composite widget there is a section on layout semantics that
follows the resource description. This section will describe the
effect of constraint resources on the layout of the children, as well
as a general description of where it prefers to place its children.
</p><p>
Descriptions of default translations and action routines come next, for
widgets to which they apply. The last item in each widget's
documentation is the description of all convenience routines provided by
the widget.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Input_Focus"></a>Input Focus</h2></div></div></div><p>
The Intrinsics define a resource on all Shell widgets that interact with
the window manager called <code class="function">input</code>. This resource requests the
assistance of window manager in acquiring the input focus. The
resource defaults to <code class="function">False</code> in the Intrinsics, but is redefined to
default to <code class="function">True</code> when an application is using the Athena widget
set. An application programmer may override this default and set the
resource back to <code class="function">False</code> if the application does not need the window
manager to give it the input focus. See the
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span> for details
on the <span class="emphasis"><em>input</em></span> resource.
</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="idp51077360"></a>Chapter 2. Using Widgets</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Using_Widgets">Using Widgets</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Setting_the_Locale">Setting the Locale</a></span></dt><dt><span class="sect2"><a href="#Initializing_the_Toolkit">Initializing the Toolkit</a></span></dt><dt><span class="sect2"><a href="#Creating_a_Widget">Creating a Widget</a></span></dt><dt><span class="sect2"><a href="#Common_Resources">Common Resources</a></span></dt><dt><span class="sect2"><a href="#Resource_Conversions">Resource Conversions</a></span></dt><dt><span class="sect2"><a href="#Realizing_a_Widget">Realizing a Widget</a></span></dt><dt><span class="sect2"><a href="#Processing_Events">Processing Events</a></span></dt><dt><span class="sect2"><a href="#Standard_Widget_Manipulation_Functions">Standard Widget Manipulation Functions</a></span></dt><dt><span class="sect2"><a href="#Using_the_Client_Callback_Interface">Using the Client Callback Interface</a></span></dt><dt><span class="sect2"><a href="#Programming_Considerations">Programming Considerations</a></span></dt><dt><span class="sect2"><a href="#Example_Programs">Example Programs</a></span></dt></dl></dd></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Using_Widgets"></a>Using Widgets</h2></div></div></div><p>
Widgets serve as the primary tools for building a user interface or
application environment. The Athena widget set consists of primitive
widgets that contain no children (for example, a command button) and
composite widgets which may contain one or more widget children (for
example, a Box widget).
</p><p>
The remaining chapters explain the widgets that are provided
by the Athena widget set.
These user-interface components serve as an interface for
application programmers who do not want to implement their own widgets.
In addition, they serve as a starting point
for those widget programmers who, using the Intrinsics mechanisms,
want to implement alternative application programming interfaces.
</p><p>
This chapter is a brief introduction to widget programming. The
examples provided use the Athena widgets, though most of the concepts
will apply to all widget sets. Although there are several programming
interfaces to the X Toolkit, only one is described here. A full
description of the programming interface is provided in the document
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Setting_the_Locale"></a>Setting the Locale</h3></div></div></div><p>
If it is desirable that the application take advantage of
internationalization (i18n), you must establish locale with
<code class="function">XtSetLanguageProc</code>
before <code class="function">XtDisplayInitialize</code> or <a class="xref" href="#XtAppInitialize"><code class="function"> XtAppInitialize</code></a>
is called. For full details, please refer to the document
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>, section 2.2. However, the following simplest-case
call is sufficient in many or most applications.
</p><p>
</p><pre class="literallayout">
XtSetLanguageProc(NULL, NULL, NULL);
</pre><p>
</p><p>
Most notably, this will affect the Standard C locale, determine which
resource files will be loaded, and what fonts will be required of FontSet
specifications. In many cases, the addition of this line is the only source change
required to internationalize Xaw programs, and will not disturb the function
of programs in the default "C" locale.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Initializing_the_Toolkit"></a>Initializing the Toolkit</h3></div></div></div><p>
You must call a toolkit initialization function before invoking any
other toolkit routines (besides locale setting, above).
<a class="xref" href="#XtAppInitialize"><code class="function"> XtAppInitialize</code></a>
opens the X server connection, parses the command line,
and creates an initial widget that will serve as the root of
a tree of widgets created by this application.
</p><div class="funcsynopsis"><a id="XtAppInitialize"></a><p><code class="funcdef">Widget<strong class="fsfunc"> XtAppInitialize</strong>(</code>XtAppContext<var class="pdparam"> app_context_return</var>, String<var class="pdparam"> application_class</var>, XrmOptionDescRec<var class="pdparam"> options</var>, Cardinal<var class="pdparam"> num_options</var>, int<var class="pdparam"> *argc_in_out</var>, String<var class="pdparam"> *argv_in_out</var>, String<var class="pdparam"> *fallback_resources</var>, ArgList<var class="pdparam"> args</var>, Cardinal<var class="pdparam"> num_args</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>app_con_return</em></span>
</span></p></td><td><p>
Returns the application context of this application, if non-NULL.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>application_class</em></span>
</span></p></td><td><p>
Specifies the class name of this application,
which is usually the generic name for all instances of this application.
A useful convention is to form the class name by capitalizing the
first letter of the application name. For example, the application named
``xman'' has a class name of ``Xman''.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>options</em></span>
</span></p></td><td><p>
Specifies how to parse the command line for any application-specific
resources.
The options argument is passed as a parameter to
<span class="olink"><code class="function">XrmParseCommand</code></span>.
For further information,
see <span class="emphasis"><em>Xlib - C Language Interface</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_options</em></span>
</span></p></td><td><p>
Specifies the number of entries in the options list.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>argc_in_out</em></span>
</span></p></td><td><p>
Specifies a pointer to the number of command line parameters.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>argv_in_out</em></span>
</span></p></td><td><p>
Specifies the command line parameters.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fallback_resources</em></span>
</span></p></td><td><p>
Specifies resource values to be used if the site-wide application class
defaults file cannot be opened, or NULL.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>args</em></span>
</span></p></td><td><p>
Specifies the argument list to use when creating the Application shell.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_args</em></span>
</span></p></td><td><p>
Specifies the number of arguments in <span class="emphasis"><em>args</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function will remove the command line arguments that the toolkit
reads from <span class="emphasis"><em>argc_in_out</em></span>, and <span class="emphasis"><em>argv_in_out</em></span>. It will then
attempt to open the display. If the display cannot be opened, an error
message is issued and XtAppInitialize terminates the application. Once
the display is opened, all resources are read from the locations
specified by the Intrinsics. This function returns an ApplicationShell
widget to be used as the root of the application's widget tree.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Creating_a_Widget"></a>Creating a Widget</h3></div></div></div><p>
Creating a widget is a three-step process. First, the widget instance
is allocated, and various instance-specific attributes are set by
using <code class="function">XtCreateWidget</code>. Second, the widget's parent is informed
of the new child by using <code class="function">XtManageChild</code>. Finally, X windows are
created for the parent and all its children by using <a class="xref" href="#XtRealizeWidget"><code class="function"> XtRealizeWidget</code></a>
and specifying the top-most widget. The first two steps can be
combined by using <a class="xref" href="#XtCreateManagedWidget"><code class="function"> XtCreateManagedWidget</code></a>. In addition,
<a class="xref" href="#XtRealizeWidget"><code class="function"> XtRealizeWidget</code></a> is automatically called when the child becomes
managed if the parent is already realized.
</p><p>
To allocate, initialize, and manage a widget, use
<code class="function">XtCreateManagedWidget .</code>
</p><div class="funcsynopsis"><a id="XtCreateManagedWidget"></a><p><code class="funcdef">Widget<strong class="fsfunc"> XtCreateManagedWidget</strong>(</code>String<var class="pdparam"> name</var>, WidgetClass<var class="pdparam"> widget_class</var>, Widget<var class="pdparam"> parent</var>, ArgList<var class="pdparam"> args</var>, Cardinal<var class="pdparam"> num_args</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>name</em></span>
</span></p></td><td><p>
Specifies the instance name for the created widget that is used for retrieving
widget resources.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>widget_class</em></span>
</span></p></td><td><p>
Specifies the widget class pointer for the created widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>parent</em></span>
</span></p></td><td><p>
Specifies the parent widget ID.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>args</em></span>
</span></p></td><td><p>
Specifies the argument list. The argument list is a variable-length
list composed of name and value pairs that contain information
pertaining to the specific widget instance being created. For further
information, see Section 2.7.2.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_args</em></span>
</span></p></td><td><p>
Specifies the number of arguments in the argument list.
If the num_args is zero, the argument list is never referenced.
</p></td></tr></tbody></table></div><p>
</p><p>
When a widget instance is successfully created, the widget identifier
is returned to the application. If an error is encountered, the
<code class="function">XtError</code>
routine is invoked to inform the user of the error.
</p><p>
For further information, see <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Common_Resources"></a>Common Resources</h3></div></div></div><p>
Although a widget can have unique arguments that it understands, all
widgets have common arguments that provide some regularity of operation.
The common arguments allow arbitrary widgets to be managed by
higher-level components without regard for the individual widget type.
Widgets will ignore any argument that they do not understand.
</p><p>
The following resources are retrieved from the argument list
or from the resource database by all of the Athena widgets:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center">1</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center">Parent's Colormap</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"><span class="emphasis"><em>widget dependent</em></span></td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center">True</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"><span class="emphasis"><em>widget dependent</em></span></td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"><span class="emphasis"><em>widget dependent</em></span></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center">0</td></tr></tbody></table></div><p>
</p><p>
The following additional resources are retrieved from the argument list
or from the resource database by many of the Athena widgets:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center">NULL</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"><span class="emphasis"><em>widget dependent</em></span></td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center">GreyPixmap</td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Resource_Conversions"></a>Resource Conversions</h3></div></div></div><p>
Most resources in the Athena widget set have a converter registered that
will translate the string in a resource file to the correct internal
representation. While some are obvious (string to integer, for example),
others need specific mention of the allowable values. Three general
converters are described here:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Cursor
</p></li><li class="listitem"><p>
Pixel
</p></li><li class="listitem"><p>
Bitmap
</p></li></ul></div><p>
Many widgets have defined special converters that apply only to that
widget. When these occur, the documentation section for that widget
will describe the converter.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Cursor_Conversion"></a>Cursor Conversion</h4></div></div></div><p>
The value for the <code class="function">cursorName</code> resource is specified in the resource
database as a string, and is of the following forms:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A standard X cursor name from <code class="function">< X11/cursorfont.h ></code>.
The names in <code class="function">cursorfont.h</code> each describe a specific cursor. The
resource names for these cursors are exactly like the names in this file
except the <code class="function">XC_</code> is not used. The cursor definition <code class="function">XC_gumby</code>
has a resource name of <code class="function">gumby</code>.
</p></li><li class="listitem"><p>
Glyphs, as in <span class="emphasis"><em>FONT font-name glyph-index [[ font-name ] glyph-index ]</em></span>.
The first font and glyph specify the cursor source pixmap.
The second font and glyph specify the cursor mask pixmap.
The mask font defaults to the source font,
and the mask glyph index defaults to the source glyph index.
</p></li><li class="listitem"><p>
A relative or absolute file name.
If a relative or absolute file name is specified, that file is used to
create the source pixmap. Then the string "Mask" is appended to
locate the cursor mask pixmap. If the "Mask" file does not exist, the
suffix "msk" is tried. If "msk" fails, no cursor mask will be used.
If the filename does not start with '/' or './' the the bitmap
file path is used (see section 2.4.3).
</p></li></ul></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Pixel_Conversion"></a>Pixel Conversion</h4></div></div></div><p>
The string-to-pixel converter takes any name that is acceptable to
XParseColor (see <span class="emphasis"><em>Xlib - C Language Interface</em></span>). In addition this routine understands
the special toolkit symbols `XtDefaultForeground' and
`XtDefaultBackground', described in <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>. In short the acceptable
pixel names are:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Any color name for the rgb.txt file (typically in the directory
/usr/lib/X11 on POSIX systems).
</p></li><li class="listitem"><p>
A numeric specification of the form #<red><green><blue> where these
numeric values are hexadecimal digits (both upper and lower case).
</p></li><li class="listitem"><p>
The special strings `XtDefaultForeground' and `XtDefaultBackground'
</p></li></ul></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Bitmap_Conversion"></a>Bitmap Conversion</h4></div></div></div><p>
The string-to-bitmap converter attempts to locate a file containing
bitmap data whose name is specified by the input string. If the file
name is relative (i.e. does not begin with / or ./), the directories to
be searched are specified in the <code class="function">bitmapFilePath</code> resource--class
<code class="function">BitmapFilePath</code>. This resource specifies a colon (:) separated
list of directories that will be searched for the named bitmap or
cursor glyph (see section 2.4.1). The <code class="function">bitmapFilePath</code> resource is
global to the application, and may <code class="function">not</code> be specified differently
for each widget that wishes to convert a cursor to bitmap. In addition
to the directories specified in the <code class="function">bitmapFilePath</code> resource a
default directory is searched. When using POSIX the default
directory is
<code class="function">/usr/include/X11/bitmaps .</code>
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Realizing_a_Widget"></a>Realizing a Widget</h3></div></div></div><p>
The
<a class="xref" href="#XtRealizeWidget"><code class="function"> XtRealizeWidget</code></a>
function performs two tasks:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Calculates the geometry constraints of all managed descendants
of this widget. The actual calculation is put off until realize time
for performance reasons.
</p></li><li class="listitem"><p>
Creates an X window for the widget and, if it is a composite widget,
realizes each of its managed children.
</p><div class="funcsynopsis"><a id="XtRealizeWidget"></a><p><code class="funcdef">void<strong class="fsfunc"> XtRealizeWidget</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p></li><li class="listitem"><p>
Specifies the widget.
</p></li></ul></div><p>
For further information about this function,
see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Processing_Events"></a>Processing Events</h3></div></div></div><p>
Now that the application has created, managed and realized its
widgets, it is ready to process the events that will be delivered by the
X Server to this client. A function call that will process the
events is <a class="xref" href="#XtAppMainLoop"><code class="function"> XtAppMainLoop</code></a>.
</p><div class="funcsynopsis"><a id="XtAppMainLoop"></a><p><code class="funcdef">void<strong class="fsfunc"> XtAppMainLoop</strong>(</code>XtAppContext<var class="pdparam"> app_context</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>app_context</em></span>
</span></p></td><td><p>
Specifies the application context of this application. The value is
normally returned by <a class="xref" href="#XtAppInitialize"><code class="function"> XtAppInitialize</code></a>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function never returns: it is an infinite loop that processes the
X events. User input can be handled through callback procedures and
application defined action routines. More details are provided in
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Standard_Widget_Manipulation_Functions"></a>Standard Widget Manipulation Functions</h3></div></div></div><p>
After a widget has been created, a client can interact with that
widget by calling one of the standard widget manipulation routines
provided by the Intrinsics, or a widget class-specific manipulation routine.
</p><p>
The Intrinsics provide generic routines to give the application programmer
access to a set of standard widget functions. The common widget
routines let an application or composite widget perform the following
operations on widgets without requiring explicit knowledge of the widget
type.
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Control the mapping of widget windows
</p></li><li class="listitem"><p>
Destroy a widget instance
</p></li><li class="listitem"><p>
Obtain an argument value
</p></li><li class="listitem"><p>
Set an argument value
</p></li></ul></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Mapping_Widgets"></a>Mapping Widgets</h4></div></div></div><p>
By default,
widget windows are mapped (made viewable) automatically by
<a class="xref" href="#XtRealizeWidget"><code class="function"> XtRealizeWidget</code></a>. This behavior can be disabled by using
<a class="xref" href="#XtSetMappedWhenManaged"><code class="function"> XtSetMappedWhenManaged</code></a>, making the client responsible for calling
<a class="xref" href="#XtMapWidget"><code class="function"> XtMapWidget</code></a> to make the widget viewable.
</p><div class="funcsynopsis"><a id="XtSetMappedWhenManaged"></a><p><code class="funcdef">void<strong class="fsfunc"> XtSetMappedWhenManaged</strong>(</code>Widget<var class="pdparam"> w</var>, Boolean<var class="pdparam"> map_when_managed</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>map_when_managed</em></span>
</span></p></td><td><p>
Specifies the new value.
If map_when_managed is <code class="function">True</code>, the widget is mapped automatically
when it is realized. If map_when_managed is <code class="function">False</code>, the client
must call
<a class="xref" href="#XtMapWidget"><code class="function"> XtMapWidget</code></a>
or make a second call to
<a class="xref" href="#XtSetMappedWhenManaged"><code class="function"> XtSetMappedWhenManaged</code></a>
to cause the child window to be mapped.
</p></td></tr></tbody></table></div><p>
</p><p>
The definition for
<a class="xref" href="#XtMapWidget"><code class="function"> XtMapWidget</code></a>
is:
</p><div class="funcsynopsis"><a id="XtMapWidget"></a><p><code class="funcdef">void<strong class="fsfunc"> XtMapWidget</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget.
</p></td></tr></tbody></table></div><p>
</p><p>
When you are creating several children in sequence for a previously
realized common parent it is generally more efficient to construct a
list of children as they are created (using <code class="function">XtCreateWidget</code>) and
then use <a class="xref" href="#XtManageChildren"><code class="function"> XtManageChildren</code></a> to request that their parent managed
them all at once. By managing a list of children at one time, the
parent can avoid wasteful duplication of geometry processing and the
associated ``screen flash''.
</p><div class="funcsynopsis"><a id="XtManageChildren"></a><p><code class="funcdef">void<strong class="fsfunc"> XtManageChildren</strong>(</code>WidgetList<var class="pdparam"> children</var>, Cardinal<var class="pdparam"> num_children</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>children</em></span>
</span></p></td><td><p>
Specifies a list of children to add.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_children</em></span>
</span></p></td><td><p>
Specifies the number of children to add.
</p></td></tr></tbody></table></div><p>
</p><p>
If the parent is already visible on the screen, it is especially
important to batch updates so that the minimum amount of visible window
reconfiguration is performed.
</p><p>
For further information about these functions,
see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Destroying_Widgets"></a>Destroying Widgets</h4></div></div></div><p>
To destroy a widget instance of any type, use
<a class="xref" href="#XtDestroyWidget"><code class="function"> XtDestroyWidget</code></a>
</p><div class="funcsynopsis"><a id="XtDestroyWidget"></a><p><code class="funcdef">void<strong class="fsfunc"> XtDestroyWidget</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget.
</p></td></tr></tbody></table></div><p>
</p><p>
<a class="xref" href="#XtDestroyWidget"><code class="function"> XtDestroyWidget</code></a>
destroys the widget and recursively destroys any children that it may have,
including the windows created by its children.
After calling
<code class="function">XtDestroyWidget ,</code>
no further references should be made to the widget or any children
that the destroyed widget may have had.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Retrieving_Widget_Resource_Values"></a>Retrieving Widget Resource Values</h4></div></div></div><p>
To retrieve the current value of a resource attribute associated
with a widget instance, use
<code class="function">XtGetValues .</code>
</p><div class="funcsynopsis"><a id="XtGetValues"></a><p><code class="funcdef">void<strong class="fsfunc"> XtGetValues</strong>(</code>Widget<var class="pdparam"> w</var>, ArgList<var class="pdparam"> args</var>, Cardinal<var class="pdparam"> num_args</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>args</em></span>
</span></p></td><td><p>
Specifies a variable-length argument list of name and <code class="function">address</code>
pairs that contain the resource name and the address into which the
resource value is stored.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_args</em></span>
</span></p></td><td><p>
Specifies the number of arguments in the argument list.
</p></td></tr></tbody></table></div><p>
</p><p>
The arguments and values passed in the argument list are dependent on
the widget. Note that the caller is responsible for providing space
into which the returned resource value is copied; the <code class="function">ArgList</code>
contains a pointer to this storage (e.g. x and y must be
allocated as Position). For further information, see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Modifying_Widget_Resource_Values"></a>Modifying Widget Resource Values</h4></div></div></div><p>
To modify the current value of a resource attribute associated with a
widget instance, use
<code class="function">XtSetValues .</code>
</p><div class="funcsynopsis"><a id="XtSetValues"></a><p><code class="funcdef">void<strong class="fsfunc"> XtSetValues</strong>(</code>Widget<var class="pdparam"> w</var>, ArgList<var class="pdparam"> args</var>, Cardinal<var class="pdparam"> num_args</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>args</em></span>
</span></p></td><td><p>
Specifies an array of name and <code class="function">value</code> pairs that contain the
arguments to be modified and their new values.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>num_args</em></span>
</span></p></td><td><p>
Specifies the number of arguments in the argument list.
</p></td></tr></tbody></table></div><p>
</p><p>
The arguments and values that are passed will depend on the widget
being modified. Some widgets may not allow certain resources to be
modified after the widget instance has been created or realized.
No notification is given if any part of a <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a> request is
ignored.
</p><p>
For further information about these functions, see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
The argument list entry for
<a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a>
specifies the address to which the caller wants the value copied. The
argument list entry for
<code class="function">XtSetValues ,</code>
however, contains the new value itself, if the size of value is less than
sizeof(XtArgVal) (architecture dependent, but at least sizeof(long));
otherwise, it is a pointer to the value. String resources are always
passed as pointers, regardless of the length of the string.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Using_the_Client_Callback_Interface"></a>Using the Client Callback Interface</h3></div></div></div><p>
Widgets can communicate changes in their state to their clients
by means of a callback facility.
The format for a client's callback handler is:
</p><div class="funcsynopsis"><a id="CallbackProc"></a><p><code class="funcdef">void<strong class="fsfunc"> CallbackProc</strong>(</code>Widget<var class="pdparam"> w</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> call_data</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies widget for which the callback is registered.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies arbitrary client-supplied data that the widget should pass
back to the client when the widget executes the client's callback
procedure. This is a way for the client registering the callback to
also register client-specific data: a pointer to additional information
about the widget, a reason for invoking the callback, and so on. If no
additional information is necessary, NULL may be passed as this argument.
This field is also frequently known as the <span class="emphasis"><em>closure</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>call_data</em></span>
</span></p></td><td><p>
Specifies any callback-specific data the widget wants to pass to the client.
For example, when Scrollbar executes its <code class="function">jumpProc</code> callback list,
it passes the current position of the thumb in <span class="emphasis"><em>call_data</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
Callbacks can be registered either by creating an argument containing
the callback list described below or by using the special convenience
routines <a class="xref" href="#XtAddCallback"><code class="function"> XtAddCallback</code></a> and <code class="function">XtAddCallbacks</code>. When the widget
is created, a pointer to a list of callback procedure and data pairs can
be passed in the argument list to
<code class="function">XtCreateWidget .</code>
The list is of type
<code class="function">XtCallbackList :</code>
</p><p>
</p><pre class="literallayout">
typedef struct {
XtCallbackProc callback;
XtPointer closure;
} XtCallbackRec, *XtCallbackList;
</pre><p>
</p><p>
The callback list must be allocated and initialized before calling
<code class="function">XtCreateWidget .</code>
The end of the list is identified by an entry containing NULL in
callback and closure. Once the widget is created, the client can change
or de-allocate this list; the widget itself makes no further reference
to it. The closure field contains the client_data passed to the
callback when the callback list is executed.
</p><p>
The second method for registering callbacks is to use
<a class="xref" href="#XtAddCallback"><code class="function"> XtAddCallback</code></a>
after the widget has been created.
</p><div class="funcsynopsis"><a id="XtAddCallback"></a><p><code class="funcdef">void<strong class="fsfunc"> XtAddCallback</strong>(</code>Widget<var class="pdparam"> w</var>, String<var class="pdparam"> callback_name</var>, XtCallbackProc<var class="pdparam"> callback</var>, XtPointer<var class="pdparam"> client_data</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the widget to add the callback to.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>callback_name</em></span>
</span></p></td><td><p>
Specifies the callback list within the widget to append to.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>callback</em></span>
</span></p></td><td><p>
Specifies the callback procedure to add.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies the data to be passed to the callback when it is invoked.
</p></td></tr></tbody></table></div><p>
</p><p>
<a class="xref" href="#XtAddCallback"><code class="function"> XtAddCallback</code></a>
adds the specified callback to the list for the named widget.
</p><p>
All widgets provide a callback list named
<code class="function">destroyCallback</code>
where clients can register procedures that are to be executed when the
widget is destroyed. The destroy callbacks are executed when the widget
or an ancestor is destroyed. The <span class="emphasis"><em>call_data</em></span> argument is unused for
destroy callbacks.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Programming_Considerations"></a>Programming Considerations</h3></div></div></div><p>
This section provides some guidelines on how to set up an application
program that uses the X Toolkit.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Writing_Applications"></a>Writing Applications</h4></div></div></div><p>
When writing an application that uses the X Toolkit,
you should make sure that your application performs the following:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Include
<code class="function">< X11/Intrinsic.h ></code>
in your application programs.
This header file automatically includes
<code class="function">< X11/Xlib.h >,</code>
so all Xlib functions also are defined.
It may also be necessary to include <code class="function">< X11/StringDefs.h ></code> when setting
up argument lists, as many of the XtN<span class="emphasis"><em>something</em></span> definitions are
only defined in this file.
</p></li><li class="listitem"><p>
Include the widget-specific header files for each widget type
that you need to use.
For example,
<code class="function">< X11/Xaw/Label.h ></code>
and
<code class="function">< X11/Xaw/Command.h >.</code>
</p></li><li class="listitem"><p>
Call the
<a class="xref" href="#XtAppInitialize"><code class="function"> XtAppInitialize</code></a>
function before invoking any other toolkit or Xlib functions.
For further information,
see Section 2.1 and the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></li><li class="listitem"><p>
To pass attributes to the widget creation routines that will override
any site or user customizations, set up argument lists. In this
document, a list of valid argument names is provided in the discussion
of each widget. The names each have a global symbol defined that begins
with <code class="function">XtN</code> to help catch spelling errors. For example,
<code class="function">XtNlabel</code> is defined for the <code class="function">label</code> resource of many widgets.
</p></li><li class="listitem"><p>
For further information, see Section 2.9.2.2.
</p></li><li class="listitem"><p>
When the argument list is set up, create the widget with the
<a class="xref" href="#XtCreateManagedWidget"><code class="function"> XtCreateManagedWidget</code></a> function. For further information, see
Section 2.2 and the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></li><li class="listitem"><p>
If the widget has any callback routines, set by the
<code class="function">XtNcallback</code>
argument or the
<a class="xref" href="#XtAddCallback"><code class="function"> XtAddCallback</code></a>
function, declare these routines within the application.
</p></li><li class="listitem"><p>
After creating the initial widget hierarchy, windows must be created
for each widget by calling
<a class="xref" href="#XtRealizeWidget"><code class="function"> XtRealizeWidget</code></a>
on the top level widget.
</p></li><li class="listitem"><p>
Most applications now sit in a loop processing events using
<code class="function">XtAppMainLoop ,</code>
for example:
</p></li><li class="listitem"><p>
</p><pre class="literallayout">
XtCreateManagedWidget(<span class="emphasis"><em>name</em></span>, <span class="emphasis"><em>class</em></span>, <span class="emphasis"><em>parent</em></span>, <span class="emphasis"><em>args</em></span>, <span class="emphasis"><em>num_args</em></span>);
XtRealizeWidget(<span class="emphasis"><em>shell</em></span>);
XtAppMainLoop(<span class="emphasis"><em>app_context</em></span>);
</pre><p>
</p></li><li class="listitem"><p>
For information about this function, see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></li><li class="listitem"><p>
Link your application with
<code class="function">libXaw</code>
(the Athena widgets),
<code class="function">libXmu</code>
(miscellaneous utilities),
<code class="function">libXt</code>
(the X Toolkit Intrinsics),
<code class="function">libSM</code>
(Session Management),
<code class="function">libICE</code>
(Inter-Client Exchange),
<code class="function">libXext</code>
(the extension library needed for the shape extension code which allows
rounded Command buttons), and
<code class="function">libX11</code>
(the core X library).
The following provides a sample command line:
</p></li><li class="listitem"><p>
</p><pre class="literallayout">
cc -o <span class="emphasis"><em>application</em></span> <span class="emphasis"><em>application</em></span>.c \-lXaw \-lXmu \-lXt \
\-lSM \-lICE \-lXext \-lX11
</pre><p>
</p></li></ol></div></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Changing_Resource_Values"></a>Changing Resource Values</h4></div></div></div><p>
The Intrinsics support two methods of changing the default resource
values; the resource manager, and an argument list passed into
XtCreateWidget. While resources values will get updated no matter
which method you use, the two methods provide slightly different
functionality.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">Resource Manager</span></p></td><td><p>
This method picks up resource definitions described in <span class="emphasis"><em>Xlib - C Language Interface</em></span> from
many different locations at run time. The locations most important to
the application programmer are the <span class="emphasis"><em>fallback resources</em></span> and the
<span class="emphasis"><em>app-defaults</em></span> file, (see <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span> for the complete list).
Since these resource are loaded at run time, they can be overridden by
the user, allowing an application to be customized to fit the
particular needs of each individual user. These values can also be
modified without the need to rebuild the application, allowing rapid
prototyping of user interfaces. Application programmers should use
resources in preference to hard-coded values whenever possible.
</p></td></tr><tr><td><p><span class="term">Argument Lists</span></p></td><td><p>
The values passed into the widget at creation time via an argument list
cannot be modified by the user, and allow no opportunity for
customization. It is used to set resources that cannot be specified as
strings (e.g. callback lists) or resources that should not be
overridden (e.g. window depth) by the user.
</p></td></tr></tbody></table></div><p>
</p><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a id="Specifying_Resources"></a>Specifying Resources</h5></div></div></div><p>
It is important for all X Toolkit application programmers to
understand how to use the X Resource Manager to specify resources for
widgets in an X application. This section will describe the most common
methods used to specify these resources, and how to use the X Resource
manager.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Xrdb</code>
</span></p></td><td><p>
The <code class="function">xrdb</code> utility may be used to load a file containing
resources into the X server. Once the resources are loaded, the
resources will affect any new applications started on the display that
they were loaded onto.
</p></td></tr><tr><td><p><span class="term">Application Defaults</span></p></td><td><p>
The application defaults (app-defaults) file (normally in
/usr/lib/X11/app-defaults/<span class="emphasis"><em>classname</em></span>) for an application is loaded
whenever the application is started.
</p></td></tr></tbody></table></div><p>
</p><p>
The resource specification has two colon-separated parts, a name, and
a value. The <span class="emphasis"><em>value</em></span> is a string whose format is dependent on the
resource specified by <span class="emphasis"><em>name</em></span>. <span class="emphasis"><em>Name</em></span> is constructed by
appending a resource name to a full widget name.
</p><p>
The full widget name is a list of the name of every ancestor of the
desired widget separated by periods (.). Each widget also has a class
associated with it. A class is a type of widget (e.g. Label or
Scrollbar or Box). Notice that class names, by convention, begin with
capital letters and instance names begin with lower case letters. The
class of any widget may be used in place of its name in a resource
specification. Here are a few examples:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
xman.form.button1
</span></p></td><td><p>
This is a fully specified resource name, and will affect only widgets
called button1 that are children of widgets called form that are
children of
applications named xman. (Note that while typically two widgets that
are siblings will have different names, it is not prohibited.)
</p></td></tr><tr><td><p><span class="term">
Xman.Form.Command
</span></p></td><td><p>
This will match any Command widget that is a child of a Form widget
that is itself a child of an application of class <span class="emphasis"><em>Xman</em></span>.
</p></td></tr><tr><td><p><span class="term">
Xman.Form.button1
</span></p></td><td><p>
This is a mixed resource name with both widget names and classes specified.
</p></td></tr></tbody></table></div><p>
</p><p>
This syntax allows an application programmer to specify any widget
in the widget tree. To match more than one widget (for example a user
may want to make all Command buttons blue), use an asterisk (*)
instead of a period. When an asterisk is used, any number of widgets
(including zero) may exist between the two widget names. For example:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
Xman*Command
</span></p></td><td><p>
This matches all Command widgets in the Xman application.
</p></td></tr><tr><td><p><span class="term">
Foo*button1
</span></p></td><td><p>
This matches any widget in the Foo application that is named <span class="emphasis"><em>button1</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
The root of all application widget trees is the widget returned by
<a class="xref" href="#XtAppInitialize"><code class="function"> XtAppInitialize</code></a>. Even though this is actually an
ApplicationShell widget, the toolkit replaces its widget class with the
class name of the application. The name of this widget is either
the name used to invoke the application (<code class="function">argv[0]</code>) or the name of
the application specified using the standard <span class="emphasis"><em>-name</em></span> command line
option supported by the Intrinsics.
</p><p>
The last step in constructing the resource name is to append the name of
the resource with either a period or asterisk to the full or partial
widget name already constructed.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
*foreground:Blue
</span></p></td><td><p>
Specifies that all widgets in all applications will have a foreground
color of blue.
</p></td></tr><tr><td><p><span class="term">
Xman*borderWidth:10
</span></p></td><td><p>
Specifies that all widgets in an application whose class is Xman will
have a border width of 10 (pixels).
</p></td></tr><tr><td><p><span class="term">
xman.form.button1.label:Testing
</span></p></td><td><p>
Specifies that a particular widget in the xman application will have a
label named <span class="emphasis"><em>Testing</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
An exclamation point (!) in the first column of a line indicates
that the rest of the line should be treated as a comment.
</p><p>
<code class="function">Final Words</code>
</p><p>
The Resource manager is a powerful tool that can be used very
effectively to customize X Toolkit applications at run time by either the
application programmer or the user. Some final points to note:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
An application programmer may add new resources to their
application. These resources are associated with the global
application, and not any particular widget. The X Toolkit function used for
adding the application resources is <code class="function">XtGetApplicationResources</code>.
</p></li><li class="listitem"><p>
Be careful when creating resource files. Since widgets will
ignore resources that they do not understand, any spelling
errors will cause a resource to have no effect.
</p></li><li class="listitem"><p>
Only one resource line will match any given resource. There is a set
of precedence rules, which take the following general stance.
</p></li><li class="listitem"><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
More specific overrides less specific, thus period always overrides asterisk.
</p></li><li class="listitem"><p>
Names on the left are more specific and override names on the right.
</p></li><li class="listitem"><p>
When resource specifications are exactly the same, user defaults
will override program defaults.
</p></li></ul></div></li></ul></div><p>
For a complete explanation of the rules of precedence, and
other specific topics see <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span> and <span class="emphasis"><em>Xlib - C Language Interface</em></span>.
</p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a id="Creating_Argument_Lists"></a>Creating Argument Lists</h5></div></div></div><p>
To set up an argument list for the inline specification of widget attributes,
you may use any of the four approaches discussed in this section.
Each resource name has a global symbol associated with it. This
global symbol has the form XtN<span class="emphasis"><em>resource name</em></span>. For example, the
symbol for ``foreground'' is <code class="function">XtNforeground</code>. For further information,
see the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p><p>
Argument are specified by using the following structure:
</p><p>
</p><pre class="literallayout">
typedef struct {
String name;
XtArgVal value;
} Arg, *ArgList;
</pre><p>
</p><p>
The first approach is to statically initialize the argument list.
For example:
</p><p>
</p><pre class="literallayout">
static Arg arglist[] = {
{XtNwidth, (XtArgVal) 400},
{XtNheight, (XtArgVal) 300},
};
</pre><p>
</p><p>
This approach is convenient for lists that do not need to be computed
at runtime and makes adding or deleting new elements easy.
The
<code class="function">XtNumber</code>
macro is used to compute the number of elements in the argument list,
preventing simple programming errors:
</p><p>
</p><pre class="literallayout">
XtCreateWidget(<span class="emphasis"><em>name</em></span>, <span class="emphasis"><em>class</em></span>, <span class="emphasis"><em>parent</em></span>, <span class="emphasis"><em>arglist</em></span>, XtNumber(<span class="emphasis"><em>arglist</em></span>));
</pre><p>
</p><p>
The second approach is to use the
<code class="function">XtSetArg</code>
macro.
For example:
</p><p>
</p><pre class="literallayout">
Arg arglist[10];
XtSetArg(arglist[1], XtNwidth, 400);
XtSetArg(arglist[2], XtNheight, 300);
</pre><p>
</p><p>
To make it easier to insert and delete entries,
you also can use a variable index:
</p><p>
</p><pre class="literallayout">
Arg arglist[10];
Cardinal i=0;
XtSetArg(arglist[i], XtNwidth, 400); i++;
XtSetArg(arglist[i], XtNheight, 300); i++;
</pre><p>
</p><p>
The i variable can then be used as the argument list count in the widget
create function.
In this example,
<code class="function">XtNumber</code>
would return 10, not 2, and therefore is not useful.
You should not use auto-increment or auto-decrement
within the first argument to
<code class="function">XtSetArg .</code>
As it is currently implemented,
<code class="function">XtSetArg</code>
is a macro that dereferences the first argument twice.
</p><p>
The third approach is to individually set the elements of the
argument list array:
</p><p>
</p><pre class="literallayout">
Arg arglist[10];
arglist[0].name = XtNwidth;
arglist[0].value = (XtArgVal) 400;
arglist[1].name = XtNheight;
arglist[1].value = (XtArgVal) 300;
</pre><p>
</p><p>
Note that in this example, as in the previous example,
<code class="function">XtNumber</code>
would return 10, not 2, and therefore would not be useful.
</p><p>
The fourth approach is to use a mixture of the first and third approaches:
you can statically define the argument list but modify some entries at runtime.
For example:
</p><p>
</p><pre class="literallayout">
static Arg arglist[] = {
{XtNwidth, (XtArgVal) 400},
{XtNheight, (XtArgVal) NULL},
};
arglist[1].value = (XtArgVal) 300;
</pre><p>
</p><p>
In this example,
<code class="function">XtNumber</code>
can be used, as in the first approach, for easier code maintenance.
</p></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Example_Programs"></a>Example Programs</h3></div></div></div><p>
The best way to understand how to use any programming library is by
trying some simple examples. A collection of example programs that
introduces each of the widgets in that Athena widget set, as well as many
important toolkit programming concepts, is available in the X11R5 contrib
release as distributed by the X Consortium. It can be found in the
directory <code class="filename">contrib/examples/Xaw</code> in the archive
at <a class="ulink" href="http://www.x.org/releases/X11R5/contrib-1.tar.Z" target="_top">http://www.x.org/releases/X11R5/contrib-1.tar.Z</a>
See the <code class="filename">README</code> file from that directory for a guide
to the examples.
</p></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Simple_Widgets"></a>Chapter 3. Simple Widgets</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Command_Widget">Command Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Command_Actions">Command Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Grip_Widget">Grip Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Grip::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Grip_Actions">Grip Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Label_Widget">Label Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Label::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#List_Widget">List Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#List::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#List_Actions">List Actions</a></span></dt><dt><span class="sect2"><a href="#List_Callbacks">List Callbacks</a></span></dt><dt><span class="sect2"><a href="#Changing_the_List">Changing the List</a></span></dt><dt><span class="sect2"><a href="#Highlighting_an_Item">Highlighting an Item</a></span></dt><dt><span class="sect2"><a href="#Unhighlighting_an_Item">Unhighlighting an Item</a></span></dt><dt><span class="sect2"><a href="#Retrieving_the_Currently_Selected_Item">Retrieving the Currently Selected Item</a></span></dt><dt><span class="sect2"><a href="#Restrictions">Restrictions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Panner_Widget">Panner Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Panner::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Panner_Actions">Panner Actions</a></span></dt><dt><span class="sect2"><a href="#Panner_Callbacks">Panner Callbacks</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Repeater_Widget">Repeater Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Repeater::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Repeater_Actions">Repeater Actions</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Scrollbar_Widget">Scrollbar Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Scrollbar::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Scrollbar_Actions">Scrollbar Actions</a></span></dt><dt><span class="sect2"><a href="#Scrollbar_Callbacks">Scrollbar Callbacks</a></span></dt><dt><span class="sect2"><a href="#Convenience_Routines">Convenience Routines</a></span></dt><dt><span class="sect2"><a href="#Setting_Float_Resources">Setting Float Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Simple_Widget">Simple Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Simple::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#StripChart_Widget">StripChart Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#StripChart::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Getting_the_StripChart_Value">Getting the StripChart Value</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Toggle_Widget">Toggle Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Toggle::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Toggle_Actions">Toggle Actions</a></span></dt><dt><span class="sect2"><a href="#Toggle_Actions_b">Toggle Actions</a></span></dt><dt><span class="sect2"><a href="#Radio_Groups">Radio Groups</a></span></dt><dt><span class="sect2"><a href="#Toggle::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd></dl></div><p>
Each of these widgets performs a specific user interface function. They
are <span class="emphasis"><em>simple</em></span> because they cannot have widget children\(emthey may only
be used as leaves of the widget tree. These widgets display information or
take user input.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><code class="function">Command</code></span></p></td><td><p>
A push button that, when selected, may cause a specific action
to take place. This widget can display a multi-line string or a bitmap or pixmap image.
</p></td></tr><tr><td><p><span class="term"><code class="function">Grip</code></span></p></td><td><p>
A rectangle that, when selected, will cause an action to take place.
</p></td></tr><tr><td><p><span class="term"><code class="function">Label</code></span></p></td><td><p>
A rectangle that can display a multi-line string or a bitmap or pixmap image.
</p></td></tr><tr><td><p><span class="term"><code class="function">List</code></span></p></td><td><p>
A list of text strings presented in row column format that may be
individually selected. When an element is selected an action may take
place.
</p></td></tr><tr><td><p><span class="term"><code class="function">Panner</code></span></p></td><td><p>
A rectangular area containing a <span class="emphasis"><em>slider</em></span> that may be moved in two
dimensions. Notification of movement may be continuous or discrete.
</p></td></tr><tr><td><p><span class="term"><code class="function">Repeater</code></span></p></td><td><p>
A push button that triggers an action at an increasing rate when selected.
This widget can display a multi-line string or a bitmap or pixmap image.
</p></td></tr><tr><td><p><span class="term"><code class="function">Scrollbar</code></span></p></td><td><p>
A rectangular area containing a <span class="emphasis"><em>thumb</em></span> that when slid along one
dimension may cause a specific action to take place. The Scrollbar may
be oriented horizontally or vertically.
</p></td></tr><tr><td><p><span class="term"><code class="function">Simple</code></span></p></td><td><p>
The base class for most of the simple widgets. Provides a rectangular
area with a settable mouse cursor and special border.
</p></td></tr><tr><td><p><span class="term"><code class="function">StripChart</code></span></p></td><td><p>
A real time data graph that will automatically update and scroll.
</p></td></tr><tr><td><p><span class="term"><code class="function">Toggle</code></span></p></td><td><p>
A push button that contains state information. Toggles
may also be used as "radio buttons" to implement a "one of many" or
"zero or one of many" group
of buttons. This widget can display a multi-line string or a bitmap or pixmap image.
</p></td></tr></tbody></table></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Command_Widget"></a>Command Widget</h2></div></div></div><pre class="literallayout">
Application header file <X11/Xaw/Command.h>
Class header file <X11/Xaw/CommandP.h>
Class commandWidgetClass
Class Name Command
Superclass Label
</pre><p>
The Command widget is an area, often rectangular, that contains text
or a graphical image. Command widgets are often referred to as
``push buttons.'' When the pointer is over a Command widget, the
widget becomes highlighted by drawing a rectangle around its perimeter.
This highlighting indicates that the widget is ready for selection.
When mouse button 1 is pressed, the Command widget indicates that
it has been selected by reversing its foreground and background colors.
When the mouse button is released, the Command widget's <code class="function">notify</code>
action is invoked, calling all functions on its callback list. If
the pointer is moved off of the widget before the pointer button is
released, the widget reverts to its normal foreground and background
colors, and releasing the pointer button has no effect. This behavior
allows the user to cancel an action.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Resources"></a>Resources</h3></div></div></div><p>
When creating a Command widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">bitmap</td><td align="center">Bitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cornerRoundPercent</td><td align="center">CornerRoundPercent</td><td align="center">Dimension</td><td align="center"> </td><td align="center">25</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">encoding</td><td align="center">Encoding</td><td align="center">UnsignedChar</td><td align="center"> </td><td align="center">XawTextEncoding8bit</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic height + 2 * <code class="function">internalHeight</code></td></tr><tr><td align="center">highlightThickness</td><td align="center">Thickness</td><td align="center">Dimension</td><td align="center">A</td><td align="center">2 (0 if Shaped)</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">internalHeight</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">internalWidth</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">justify</td><td align="center">Justify</td><td align="center">Justify</td><td align="center"> </td><td align="center">XtJustifyCenter (center)</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">name of widget</td></tr><tr><td align="center">leftBitmap</td><td align="center">LeftBitmap</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">shapeStyle</td><td align="center">ShapeStyle</td><td align="center">ShapeStyle</td><td align="center"> </td><td align="center">Rectangle</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic width + 2 * <code class="function">internalWidth</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
\" Resource Descriptions
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Command_Actions"></a>Command Actions</h3></div></div></div><p>
The Command widget supports the following actions:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Switching the button's interior between the foreground and background
colors with <code class="function">set</code>, <code class="function">unset</code>, and <code class="function">reset</code>.
</p></li><li class="listitem"><p>
Processing application callbacks with <code class="function">notify</code>
</p></li><li class="listitem"><p>
Switching the internal border between highlighted
and unhighlighted states with <code class="function">highlight</code> and <code class="function">unhighlight</code>
</p></li></ul></div><p>
The following are the default translation bindings used by the
Command widget:
</p><p>
</p><pre class="literallayout">
<EnterWindow>: highlight(\|)
<LeaveWindow>: reset(\|)
<Btn1Down>: set(\|)
<Btn1Up>: notify(\|) unset(\|)
</pre><p>
</p><p>
The full list of actions supported by Command is:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">highlight</code>(<code class="function">condition</code>)
</span></p></td><td><p>
Displays the internal highlight border in the color (<code class="function">foreground</code>
or <code class="function">background</code> ) that contrasts with the interior color of the
Command widget. The conditions <code class="function">WhenUnset</code> and <code class="function">Always</code> are
understood by this action procedure. If no argument is passed,
<code class="function">WhenUnset</code> is assumed.
</p></td></tr><tr><td><p><span class="term">
<code class="function">unhighlight</code>(\|)
</span></p></td><td><p>
Displays the internal highlight border in the color (<code class="function">foreground</code>
or <code class="function">background</code> ) that matches the interior color of the
Command widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">set</code>(\|)
</span></p></td><td><p>
Enters the <code class="function">set</code> state, in which <code class="function">notify</code> is possible. This
action causes the button to display its interior in the
<code class="function">foreground</code> color. The label or bitmap is displayed in the
<code class="function">background</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">unset</code>(\|)
</span></p></td><td><p>
Cancels the <span class="emphasis"><em>set</em></span> state and displays the interior of the button in the
<code class="function">background</code> color. The label or bitmap is displayed in the
<code class="function">foreground</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">reset</code>(\|)
</span></p></td><td><p>
Cancels any <span class="emphasis"><em>set</em></span> or <span class="emphasis"><em>highlight</em></span> and displays the interior of the
button in the <code class="function">background</code> color, with the label or bitmap displayed
in the <code class="function">foreground</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">notify</code>(\|)
</span></p></td><td><p>
When the button is in the <code class="function">set</code> state this action calls all functions in
the callback list named by the <code class="function">callback</code> resource. The value of
the <span class="emphasis"><em>call_data</em></span> argument passed to these functions is undefined.
</p></td></tr></tbody></table></div><p>
</p><p>
A very common alternative to registering callbacks is to augment a
Command's translations with an action performing the desired
function. This often takes the form of:
</p><p>
</p><pre class="literallayout">
*Myapp*save.translations: #augment <Btn1Down>,<Btn1Up>: Save()
</pre><p>
</p><p>
When a bitmap of depth greater that one (1) is specified the
<span class="emphasis"><em>set</em></span>(), <span class="emphasis"><em>unset</em></span>(), and <span class="emphasis"><em>reset</em></span>() actions have no effect,
since there are no foreground and background colors used in a
multi-plane pixmap.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Grip_Widget"></a>Grip Widget</h2></div></div></div><pre class="literallayout">
Application header file <X11/Xaw/Grip.h>
Class header file <X11/Xaw/GripP.h>
Class gripWidgetClass
Class Name Grip
Superclass Simple
</pre><p>
The Grip widget provides a small rectangular region in which user input
events (such as ButtonPress or ButtonRelease) may be handled. The most
common use for the Grip widget is as an attachment point for visually
repositioning an object, such as the pane border in a Paned widget.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Grip::Resources"></a>Resources</h3></div></div></div><p>
When creating a Grip widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">8</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">8</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">callback</code>
</span></p></td><td><p>
All routines on this list are called whenever the <code class="function">GripAction</code>
action routine is invoked. The <span class="emphasis"><em>call_data</em></span> contains all
information passed to the action routine. A detailed description
is given below in the <code class="function">Grip Actions</code> section.
</p></td></tr><tr><td><p><span class="term">
<code class="function">foreground</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
used to flood fill the entire Grip widget.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Grip_Actions"></a>Grip Actions</h3></div></div></div><p>
The Grip widget does not declare any default event translation bindings,
but it does declare a single action routine named <code class="function">GripAction</code>. The
client specifies an arbitrary event translation table, optionally giving
parameters to the <code class="function">GripAction</code> routine.
</p><p>
The <code class="function">GripAction</code> routine executes the callbacks on the
<code class="function">callback</code> list, passing as <code class="function">call_data</code> a pointer to a
<code class="function">XawGripCallData</code> structure, defined in the Grip widget's application
header file.
</p><p>
</p><pre class="literallayout">
typedef struct _XawGripCallData {
XEvent *event;
String *params;
Cardinal num_params;
} XawGripCallDataRec, *XawGripCallData,
GripCallDataRec, *GripCallData; /* supported for R4 compatibility */
</pre><p>
</p><p>
In this structure, the <span class="emphasis"><em>event</em></span> is a pointer to the input event that
triggered the action. <span class="emphasis"><em>params</em></span> and <span class="emphasis"><em>num_params</em></span> give the string
parameters specified in the translation table for the particular event
binding.
</p><p>
The following is an example of a translation table that uses the GripAction:
</p><p>
</p><pre class="literallayout">
<Btn1Down>: GripAction(press)
<Btn1Motion>: GripAction(move)
<Btn1Up>: GripAction(release)
</pre><p>
For a complete description of the format of translation tables, see the
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Label_Widget"></a>Label Widget</h2></div></div></div><pre class="literallayout">
Application header file <X11/Xaw/Label.h>
Class header file <X11/Xaw/LabelP.h>
Class labelWidgetClass
Class Name Label
Superclass Simple
</pre><p>
A Label widget holds a graphic displayed within a
rectangular region of the screen. The graphic may be a
text string containing multiple lines of characters in an
8 bit or 16 bit character set (to be displayed with a
<span class="emphasis"><em>font</em></span>), or in a multi-byte encoding (for use with a
<span class="emphasis"><em>fontset</em></span>). The graphic may also be a bitmap or
pixmap. The Label widget will allow its graphic to be
left, right, or center justified. Normally, this widget
can be neither selected nor directly edited by the user.
It is intended for use as an output device only.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Label::Resources"></a>Resources</h3></div></div></div><p>
When creating a Label widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">bitmap</td><td align="center">Bitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">encoding</td><td align="center">Encoding</td><td align="center">UnsignedChar</td><td align="center"> </td><td align="center">XawTextEncoding8bit</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic height + 2 * <code class="function">internalHeight</code></td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">internalHeight</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">internalWidth</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">justify</td><td align="center">Justify</td><td align="center">Justify</td><td align="center"> </td><td align="center">XtJustifyCenter (center)</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">name of widget</td></tr><tr><td align="center">leftBitmap</td><td align="center">LeftBitmap</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See above</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic width + 2 * <code class="function">internalWidth</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="List_Widget"></a>List Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application header file <X11/Xaw/List.h>
Class header file <X11/Xaw/ListP.h>
Class listWidgetClass
Class Name List
Superclass Simple
</pre><p>
</p><p>
The List widget contains a list of strings formatted into rows and
columns. When one of the strings is selected, it is highlighted, and the
List widget's <code class="function">Notify</code> action is invoked, calling all routines on
its callback list. Only one string may be selected at a time.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="List::Resources"></a>Resources</h3></div></div></div><p>
When creating a List widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">columnSpacing</td><td align="center">Spacing</td><td align="center">Dimension</td><td align="center"> </td><td align="center">6</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_left_ptr</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">defaultColumns</td><td align="center">Columns</td><td align="center">int</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">FontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">forceColumns</td><td align="center">Columns</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain the list</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">internalHeight</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">internalWidth</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">list</td><td align="center">List</td><td align="center">Pointer</td><td align="center"> </td><td align="center">name of widget</td></tr><tr><td align="center">longest</td><td align="center">Longest</td><td align="center">int</td><td align="center">A</td><td align="center">0</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numberStrings</td><td align="center">NumberStrings</td><td align="center">int</td><td align="center">A</td><td align="center">computed for NULL terminated list</td></tr><tr><td align="center">pasteBuffer</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">rowSpacing</td><td align="center">Spacing</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">verticalList</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain the list</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">callback</code>
</span></p></td><td><p>
All functions on this list are called whenever the <code class="function">notify</code> action is
invoked. The <span class="emphasis"><em>call_data</em></span> argument contains information about the element
selected and is described in detail in the <code class="function">List Callbacks</code> section.
</p></td></tr><tr><td><p><span class="term">
<code class="function">columnSpacing</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">rowSpacing</code>
</span></p></td><td><p>
The amount of space, in pixels, between each of the rows and columns
in the list.
</p></td></tr><tr><td><p><span class="term">
<code class="function">defaultColumns</code>
</span></p></td><td><p>
The default number of columns. This value is used when neither the
width nor the height of the List widget is specified or when
<code class="function">forceColumns</code> is <code class="function">True</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">font</code>
</span></p></td><td><p>
The text font to use when displaying the <code class="function">list</code>, when the
<code class="function">international</code> resource is <code class="function">false</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">fontSet</code>
</span></p></td><td><p>
The text font set to use when displaying the <code class="function">list</code>, when the
<code class="function">international</code> resource is <code class="function">true</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">forceColumns</code>
</span></p></td><td><p>
Forces the default number of columns to be used regardless of the
List widget's current size.
</p></td></tr><tr><td><p><span class="term">
<code class="function">foreground</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
used to paint the text of the list elements.
</p></td></tr><tr><td><p><span class="term">
\fPinternalHeight\fP
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
\fPinternalWidth\fP
</span></p></td><td><p>
The margin, in pixels, between the edges of the list and the
corresponding edge of the List widget's window.
</p></td></tr><tr><td><p><span class="term">
<code class="function">list</code>
</span></p></td><td><p>
An array of text strings displayed in the List widget. If
<code class="function">numberStrings</code> is zero (the default) then the <code class="function">list</code> must be
NULL terminated. If a value is not specified for the <code class="function">list</code>, then
<code class="function">numberStrings</code> is set to 1, and the name of the widget is used as
the <code class="function">list</code>, and <code class="function">longest</code> is set to the length of the name of the
widget. The <code class="function">list</code> is used in place, and must be available
to the List widget for the lifetime of this widget, or until it is
changed with <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a> or <a class="xref" href="#XawListChange"><code class="function"> XawListChange</code></a>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">longest</code>
</span></p></td><td><p>
Specifies the width, in pixels, of the longest string in the current
list. The List widget will compute this value if zero (the default)
is specified. If this resource is set by hand, entries longer than this
will be clipped to fit.
</p></td></tr><tr><td><p><span class="term">
<code class="function">numberStrings</code>
</span></p></td><td><p>
The number of strings in the current list. If a value of zero (the
default) is specified, the List widget will compute it. When computing
the number of strings the List widget assumes that the <code class="function">list</code> is NULL
terminated.
</p></td></tr><tr><td><p><span class="term">
<code class="function">pasteBuffer</code>
</span></p></td><td><p>
If this resource is set to <code class="function">True</code> then the name of the currently
selected list element will be put into <code class="function">CUT_BUFFER_0</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">verticalList</code>
</span></p></td><td><p>
If this resource is set to <code class="function">True</code> then the list elements will be
presented in column major order.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="List_Actions"></a>List Actions</h3></div></div></div><p>
The List widget supports the following actions:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Highlighting and unhighlighting the list element under the
pointer with <code class="function">Set</code> and <code class="function">Unset</code>
</p></li><li class="listitem"><p>
Processing application callbacks with <code class="function">Notify</code>
</p></li></ul></div><p>
The following is the default translation table used by the List Widget:
</p><p>
</p><pre class="literallayout">
<Btn1Down>,<Btn1Up>: Set(\|) Notify(\|)
</pre><p>
</p><p>
The full list of actions supported by List widget is:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Set</code>(\|)
</span></p></td><td><p>
<span class="emphasis"><em>Sets</em></span> the list element that is currently under the pointer. To
inform the user that this element is currently set, it is drawn with
foreground and background colors reversed. If this action is called when
there is no list element under the cursor, the currently <span class="emphasis"><em>set</em></span>
element will be <span class="emphasis"><em>unset</em></span>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Unset</code>(\|)
</span></p></td><td><p>
Cancels the <span class="emphasis"><em>set</em></span> state of the element under the pointer,
and redraws it with normal foreground and background colors.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Notify</code>(\|)
</span></p></td><td><p>
Calls all callbacks on the List widget's callback list. Information
about the currently selected list element is passed in the
<span class="emphasis"><em>call_data</em></span> argument (see <code class="function">List Callbacks</code> below).
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="List_Callbacks"></a>List Callbacks</h3></div></div></div><p>
All procedures on the List widget's callback list will have a
<code class="function">XawListReturnStruct</code> passed to them as <span class="emphasis"><em>call_data</em></span>. The
structure is defined in the List widget's application header file.
</p><pre class="literallayout">
typedef struct _XawListReturnStruct {
String string; /* string shown in the list. */
int list_index; /* index of the item selected. */
} XawListReturnStruct;
</pre><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The <span class="emphasis"><em>list_index</em></span> item used to be called simply <span class="emphasis"><em>index</em></span>.
Unfortunately, this name collided with a global name defined on some
operating systems, and had to be changed.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Changing_the_List"></a>Changing the List</h3></div></div></div><p>
To change the list that is displayed, use
<code class="function">XawListChange .</code>
</p><div class="funcsynopsis"><a id="XawListChange"></a><p><code class="funcdef">void<strong class="fsfunc"> XawListChange</strong>(</code>Widget<var class="pdparam"> w</var>, String*<var class="pdparam"> list</var>, intnitems,<var class="pdparam"> longest</var>, Boolean<var class="pdparam"> resize</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the List widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>list</em></span>
</span></p></td><td><p>
Specifies the new list for the List widget to display.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>nitems</em></span>
</span></p></td><td><p>
Specifies the number of items in the <span class="emphasis"><em>list</em></span>. If a value less than 1
is specified, <span class="emphasis"><em>list</em></span> must be NULL terminated, and the number of
items will be calculated by the List widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>longest</em></span>
</span></p></td><td><p>
Specifies the length of the longest item in the <span class="emphasis"><em>list</em></span> in pixels.
If a value less than 1 is specified, the List widget will calculate the
value.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>resize</em></span>
</span></p></td><td><p>
Specifies a Boolean value that if <code class="function">True</code> indicates that the
List widget should try to resize itself after making the change.
The constraints of the List widget's parent are always enforced,
regardless of the value specified here.
</p></td></tr></tbody></table></div><p>
</p><p>
<a class="xref" href="#XawListChange"><code class="function"> XawListChange</code></a>
will <span class="emphasis"><em>unset</em></span> all list elements that are currently <code class="function">set</code> before
the list is actually changed. The <span class="emphasis"><em>list</em></span> is used in place, and must
remain usable for the lifetime of the List widget, or until <span class="emphasis"><em>list</em></span>
has been changed again with this function or with <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Highlighting_an_Item"></a>Highlighting an Item</h3></div></div></div><p>
To highlight an item in the list, use
<code class="function">XawListHighlight .</code>
</p><div class="funcsynopsis"><a id="XawListHighlight"></a><p><code class="funcdef">void<strong class="fsfunc"> XawListHighlight</strong>(</code>Widget<var class="pdparam"> w</var>, int<var class="pdparam"> item</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the List widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>item</em></span>
</span></p></td><td><p>
Specifies an index into the current list that indicates the item to be
highlighted.
</p></td></tr></tbody></table></div><p>
</p><p>
Only one item can be highlighted at a time.
If an item is already highlighted when
<a class="xref" href="#XawListHighlight"><code class="function"> XawListHighlight</code></a>
is called,
the highlighted item is unhighlighted before the new item is highlighted.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Unhighlighting_an_Item"></a>Unhighlighting an Item</h3></div></div></div><p>
To unhighlight the currently highlighted item in the list, use
<code class="function">XawListUnhighlight .</code>
</p><div class="funcsynopsis"><a id="XawListUnhighlight"></a><p><code class="funcdef">void<strong class="fsfunc"> XawListUnhighlight</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the List widget.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Retrieving_the_Currently_Selected_Item"></a>Retrieving the Currently Selected Item</h3></div></div></div><p>
To retrieve the list element that is currently <span class="emphasis"><em>set</em></span>, use
<code class="function">XawListShowCurrent .</code>
</p><div class="funcsynopsis"><a id="XawListShowCurrent"></a><p><code class="funcdef">XawListReturnStruct<strong class="fsfunc"> *XawListShowCurrent</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the List widget.
</p></td></tr></tbody></table></div><p>
</p><p>
<code class="function">XawListShowCurrent</code>
returns a pointer to an
<code class="function">XawListReturnStruct</code>
structure,
containing the currently highlighted item.
If the value of the index member is XAW_LIST_NONE,
the string member is undefined, and no item is currently selected.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Restrictions"></a>Restrictions</h3></div></div></div><p>
Many programmers create a ``scrolled list'' by putting a List
widget with many entries as a child of a Viewport widget. The
List continues to create a window as big as its contents, but
that big window is only visible where it intersects the parent
Viewport's window. (I.e., it is ``clipped.'')
</p><p>
While this is a useful technique, there is a serious drawback.
X does not support windows above 32,767 pixels in width or
height, but this height limit will be exceeded by a List's
window when the List has many entries (i.e., with a 12 point
font, about 3000 entries would be too many.)
</p><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Panner_Widget"></a>Panner Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application header file <X11/Xaw/Panner.h>
Class header file <X11/Xaw/PannerP.h>
Class pannerWidgetClass
Class Name Panner
Superclass Simple
</pre><p>
</p><p>
A Panner widget is a rectangle, called the
``canvas,'' on which another rectangle, the ``slider,'' moves in two
dimensions. It is often used with a Porthole widget to move, or
``scroll,'' a third widget in two dimensions, in which case the
slider's size and position gives feedback as to what portion of
the third widget is visible.
</p><p>
The slider may be scrolled around the canvas by pressing,
dragging, and releasing Button1; the default translation also
enables scrolling via arrow keys and some other keys. While
scrolling is in progress, the application receives notification
through callback procedures. Notification may be done either
continuously whenever the slider moves or discretely whenever the
slider has been given a new location.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Panner::Resources"></a>Resources</h3></div></div></div><p>
When creating a Panner widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">allowOff</td><td align="center">AllowOff</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">backgroundStipple</td><td align="center">BackgroundStipple</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">canvasHeight</td><td align="center">CanvasHeight</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">canvasWidth</td><td align="center">CanvasWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">defaultScale</td><td align="center">DefaultScale</td><td align="center">Dimension</td><td align="center"> </td><td align="center">8</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">depends on orientation</td></tr><tr><td align="center">internalSpace</td><td align="center">InternalSpace</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">lineWidth</td><td align="center">LineWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">reportCallback</td><td align="center">ReportCallback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">rubberBand</td><td align="center">RubberBand</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">shadowColor</td><td align="center">ShadowColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">shadowThickness</td><td align="center">ShadowThickness</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">sliderX</td><td align="center">SliderX</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">sliderY</td><td align="center">SliderY</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">sliderHeight</td><td align="center">SliderHeight</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">sliderWidth</td><td align="center">SliderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">depends on orientation</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">allowOff</code>
</span></p></td><td><p>
Whether to allow the edges of the slider to go off the edges of the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">backgroundStipple</code>
</span></p></td><td><p>
The name of a bitmap pattern to be used as the background for
the area representing the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">canvasHeight</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">canvasWidth</code>
</span></p></td><td><p>
The size of the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">defaultScale</code>
</span></p></td><td><p>
The percentage size that the Panner widget should have relative
to the size of the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">foreground</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
used to draw the slider.
</p></td></tr><tr><td><p><span class="term">
<code class="function">internalSpace</code>
</span></p></td><td><p>
The width of internal border in pixels between a slider representing the
full size of the canvas
and the edge of the Panner widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">lineWidth</code>
</span></p></td><td><p>
The width of the lines in the rubberbanding rectangle when rubberbanding
is in effect instead of continuous scrolling. The default is 0.
</p></td></tr><tr><td><p><span class="term">
<code class="function">reportCallback</code>
</span></p></td><td><p>
All functions on this callback list are called when the
<code class="function">notify</code> action is invoked. See the <code class="function">Panner Actions</code> section
for details.
</p></td></tr><tr><td><p><span class="term">
<code class="function">resize</code>
</span></p></td><td><p>
Whether or not to resize the panner whenever the canvas size is changed so
that the <code class="function">defaultScale</code> is maintained.
</p></td></tr><tr><td><p><span class="term">
<code class="function">rubberBand</code>
</span></p></td><td><p>
Whether or not scrolling should be discrete (only moving a rubberbanded
rectangle until the scrolling is done) or continuous (moving the slider
itself). This controls whether or not the <code class="function">move</code> action procedure also
invokes the <code class="function">notify</code> action procedure.
</p></td></tr><tr><td><p><span class="term">
<code class="function">shadowColor</code>
</span></p></td><td><p>
The color of the shadow underneath the slider.
</p></td></tr><tr><td><p><span class="term">
<code class="function">shadowThickness</code>
</span></p></td><td><p>
The width of the shadow underneath the slider.
</p></td></tr><tr><td><p><span class="term">
<code class="function">sliderX</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">sliderY</code>
</span></p></td><td><p>
The location of the slider in the coordinates of the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">sliderHeight</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">sliderWidth</code>
</span></p></td><td><p>
The size of the slider.
</p></td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Panner_Actions"></a>Panner Actions</h3></div></div></div><p>
The actions supported by the Panner widget are:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">start</code>()
</span></p></td><td><p>
This action begins movement of the slider.
</p></td></tr><tr><td><p><span class="term">
<code class="function">stop</code>()
</span></p></td><td><p>
This action ends movement of the slider.
</p></td></tr><tr><td><p><span class="term">
<code class="function">abort</code>()
</span></p></td><td><p>
This action ends movement of the slider and restores it to the position it
held when the <code class="function">start</code> action was invoked.
</p></td></tr><tr><td><p><span class="term">
<code class="function">move</code>()
</span></p></td><td><p>
This action moves the outline of the slider (if the <code class="function">rubberBand</code> resource
is True) or the slider itself (by invoking the <code class="function">notify</code>
action procedure).
</p></td></tr><tr><td><p><span class="term">
<code class="function">page</code>(<code class="function">xamount</code>,<code class="function">yamount</code>)
</span></p></td><td><p>
This action moves the slider by the specified amounts. The format
for the amounts is a signed or unsigned floating-point number (e.g., +1.0
or \-.5) followed
by either <code class="function">p</code> indicating pages (slider sizes), or <code class="function">c</code> indicating
canvas sizes. Thus, <span class="emphasis"><em>page(+0,+.5p)</em></span> represents vertical movement down
one-half the height of the slider and <span class="emphasis"><em>page(0,0)</em></span> represents moving to
the upper left corner of the canvas.
</p></td></tr><tr><td><p><span class="term">
<code class="function">notify</code>()
</span></p></td><td><p>
This action informs the application of the slider's current position by
invoking the <code class="function">reportCallback</code> functions registered by the application.
</p></td></tr><tr><td><p><span class="term">
<code class="function">set</code>(<code class="function">what</code>,<code class="function">value</code>)
</span></p></td><td><p>
This action changes the behavior of the Panner. The <span class="emphasis"><em>what</em></span> argument
must currently be the string <code class="function">rubberband</code> and controls the value of
the <code class="function">rubberBand</code> resource. The <code class="function">value</code> argument
may have one of the values <code class="function">on</code>, <code class="function">off</code>, or <code class="function">toggle</code>.
</p></td></tr></tbody></table></div><p>
The default bindings for Panner are:
</p><pre class="literallayout">
<Btn1Down>: start(\|)
<Btn1Motion>: move(\|)
<Btn1Up>: notify(\|) stop(\|)
<Btn2Down>: abort(\|)
<Key>KP_Enter: set(rubberband,toggle)
<Key>space: page(+1p,+1p)
<Key>Delete: page(\-1p,\-1p)
<Key>BackSpace: page(\-1p,\-1p)
<Key>Left: page(\-.5p,+0)
<Key>Right: page(+.5p,+0)
<Key>Up: page(+0,\-.5p)
<Key>Down: page(+0,+.5p)
<Key>Home: page(0,0)
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Panner_Callbacks"></a>Panner Callbacks</h3></div></div></div><p>
The functions registered on the <code class="function">reportCallback</code> list are invoked by
the <code class="function">notify</code> action as follows:
</p><div class="funcsynopsis"><a id="Panner::ReportProc"></a><p><code class="funcdef">void<strong class="fsfunc"> ReportProc</strong>(</code>Widget<var class="pdparam"> panner</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> report</var><code>)</code>;</p></div><p>
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">panner</span></p></td><td><p>
Specifies the Panner widget.
</p></td></tr><tr><td><p><span class="term">panner</span></p></td><td><p>
Specifies the client data.
</p></td></tr><tr><td><p><span class="term">panner</span></p></td><td><p>
Specifies a pointer to an <code class="function">XawPannerReport</code> structure containing
the location and size of the slider and the size of the canvas.
</p></td></tr></tbody></table></div><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Repeater_Widget"></a>Repeater Widget</h2></div></div></div><pre class="literallayout">
Application header file <X11/Xaw/Repeater.h>
Class header file <X11/Xaw/RepeaterP.h>
Class repeaterWidgetClass
Class Name Repeater
Superclass Command
</pre><p>
The Repeater widget is a subclass of the Command widget; see the
Command documentation for details. The difference is that the Repeater can call its
registered callbacks repeatedly, at an increasing rate. The default translation
does so for the duration the user holds down pointer button 1 while the pointer
is on the Repeater.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Repeater::Resources"></a>Resources</h3></div></div></div><p>
When creating a Repeater widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">bitmap</td><td align="center">Bitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cornerRoundPercent</td><td align="center">CornerRoundPercent</td><td align="center">Dimension</td><td align="center"> </td><td align="center">25</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">decay</td><td align="center">Decay</td><td align="center">Int</td><td align="center"> </td><td align="center">5</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">encoding</td><td align="center">Encoding</td><td align="center">UnsignedChar</td><td align="center"> </td><td align="center">XawTextEncoding8bit</td></tr><tr><td align="center">flash</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic height + 2 * <code class="function">internalHeight</code></td></tr><tr><td align="center">highlightThickness</td><td align="center">Thickness</td><td align="center">Dimension</td><td align="center">A</td><td align="center">2 (0 if Shaped)</td></tr><tr><td align="center">initialDelay</td><td align="center">Delay</td><td align="center">Int</td><td align="center"> </td><td align="center">200</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">internalHeight</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">internalWidth</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">justify</td><td align="center">Justify</td><td align="center">Justify</td><td align="center"> </td><td align="center">XtJustifyCenter (center)</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">name of widget</td></tr><tr><td align="center">leftBitmap</td><td align="center">LeftBitmap</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">minimumDelay</td><td align="center">MinimumDelay</td><td align="center">Int</td><td align="center"> </td><td align="center">10</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">repeatDelay</td><td align="center">Delay</td><td align="center">Int</td><td align="center"> </td><td align="center">50</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Pointer</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">shapeStyle</td><td align="center">ShapeStyle</td><td align="center">ShapeStyle</td><td align="center"> </td><td align="center">Rectangle</td></tr><tr><td align="center">startCallback</td><td align="center">StartCallback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">stopCallback</td><td align="center">StopCallback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic width + 2 * <code class="function">internalWidth</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
\" Resource Descriptions
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">decay</code>
</span></p></td><td><p>
The number of milliseconds that should be subtracted from each succeeding
interval while the Repeater button is being held down until the interval
has reached <code class="function">minimumDelay</code> milliseconds.
</p></td></tr><tr><td><p><span class="term">
<code class="function">flash</code>
</span></p></td><td><p>
Whether or not to flash the Repeater button whenever the timer goes off.
</p></td></tr><tr><td><p><span class="term">
<code class="function">initialDelay</code>
</span></p></td><td><p>
The number of milliseconds between the beginning of the Repeater button
being held down and the first invocation of the <code class="function">callback</code> function.
</p></td></tr><tr><td><p><span class="term">
<code class="function">minimumDelay</code>
</span></p></td><td><p>
The minimum time between callbacks in milliseconds.
</p></td></tr><tr><td><p><span class="term">
<code class="function">repeatDelay</code>
</span></p></td><td><p>
The number of milliseconds between each callback after the first (minus an
increasing number of <code class="function">decay</code>s).
</p></td></tr><tr><td><p><span class="term">
<code class="function">startCallback</code>
</span></p></td><td><p>
The list of functions to invoke by the <code class="function">start</code> action (typically
when the Repeater button is first pressed). The callback data parameter
is set to NULL.
</p></td></tr><tr><td><p><span class="term">
<code class="function">stopCallback</code>
</span></p></td><td><p>
The list of functions to invoke by the <code class="function">stop</code> action (typically
when the Repeater button is released). The callback data parameter
is set to NULL.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Repeater_Actions"></a>Repeater Actions</h3></div></div></div><p>
The Repeater widget supports the following actions beyond those of the Command
button:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">start</code>()
</span></p></td><td><p>
This invokes the functions on the <code class="function">startCallback</code> and <code class="function">callback</code> lists
and sets a timer to go off in <code class="function">initialDelay</code> milliseconds. The timer
will cause the <code class="function">callback</code> functions to be invoked with increasing
frequency until the <code class="function">stop</code> action occurs.
</p></td></tr><tr><td><p><span class="term">
<code class="function">stop</code>()
</span></p></td><td><p>
This invokes the functions on the <code class="function">stopCallback</code> list and prevents any
further timers from occuring until the next <code class="function">start</code> action.
</p></td></tr></tbody></table></div><p>
</p><p>
The following are the default translation bindings used by the
Repeater widget:
</p><p>
</p><pre class="literallayout">
<EnterWindow>: highlight(\|)
<LeaveWindow>: unhighlight(\|)
<Btn1Down>: set(\|) start(\|)
<Btn1Up>: stop(\|) unset(\|)
</pre><p>
</p><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Scrollbar_Widget"></a>Scrollbar Widget</h2></div></div></div><pre class="literallayout">
Application header file <X11/Xaw/Scrollbar.h>
Class header file <X11/Xaw/ScrollbarP.h>
Class scrollbarWidgetClass
Class Name Scrollbar
Superclass Simple
</pre><p>
A Scrollbar widget is a rectangle, called the ``canvas,'' on
which another rectangle, the ``thumb,'' moves in one
dimension, either vertically or horizontally. A Scrollbar
can be used alone, as a value generator, or it can be used
within a composite widget (for example, a Viewport). When a
Scrollbar is used to move, or ``scroll,'' the contents of
another widget, the size and the position of the thumb usually give
feedback as to what portion of the other widget's contents
are visible.
</p><p>
Each pointer button invokes a specific action. Pointer
buttons 1 and 3 do not move the thumb automatically.
Instead, they return the pixel position of the cursor on the
scroll region. When pointer button 2 is clicked, the thumb
moves to the current pointer position. When pointer button
2 is held down and the pointer is moved, the thumb follows
the pointer.
</p><p>
The pointer cursor in the scroll region changes depending on the current
action. When no pointer button is pressed, the cursor appears as a
double-headed arrow that points in the direction that scrolling can
occur. When pointer button 1 or 3 is pressed, the cursor appears as a
single-headed arrow that points in the logical direction that the thumb
will move. When pointer button 2 is pressed, the cursor
appears as an arrow that points to the top or the left of the thumb.
</p><p>
When the user scrolls, the application receives notification
through callback procedures. For both discrete scrolling actions, the
callback returns the Scrollbar widget, the client_data, and the pixel
position of the pointer when the button was released. For continuous
scrolling, the callback routine returns the scroll bar widget, the
client data, and the current relative position of the thumb. When the
thumb is moved using pointer button 2, the callback procedure is invoked
continuously. When either button 1 or 3 is pressed, the callback
procedure is invoked only when the button is released and the client
callback procedure is responsible for moving the thumb.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Scrollbar::Resources"></a>Resources</h3></div></div></div><p>
When creating a Scrollbar widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">depends on orientation</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">jumpProc</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">length</td><td align="center">Length</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">minimumThumb</td><td align="center">MinimumThumb</td><td align="center">Dimension</td><td align="center"> </td><td align="center">7</td></tr><tr><td align="center">orientation</td><td align="center">Orientation</td><td align="center">Orientation</td><td align="center"> </td><td align="center">XtorientVertical (vertical)</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">parent's Screen</td></tr><tr><td align="center">scrollDCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_down_arrow</td></tr><tr><td align="center">scrollHCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_h_double_arrow</td></tr><tr><td align="center">scrollLCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_left_arrow</td></tr><tr><td align="center">scrollProc</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">scrollRCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_right_arrow</td></tr><tr><td align="center">scrollUCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_up_arrow</td></tr><tr><td align="center">scrollVCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_sb_v_arrow</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">shown</td><td align="center">Shown</td><td align="center">Float</td><td align="center"> </td><td align="center">0.0</td></tr><tr><td align="center">thickness</td><td align="center">Thickness</td><td align="center">Dimension</td><td align="center"> </td><td align="center">14</td></tr><tr><td align="center">thumb</td><td align="center">Thumb</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">thumbProc</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">topOfThumb</td><td align="center">TopOfThumb</td><td align="center">Float</td><td align="center"> </td><td align="center">0.0</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">depends on orientation</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">foreground</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
used to draw the thumb.
</p></td></tr><tr><td><p><span class="term">
<code class="function">jumpProc</code>
</span></p></td><td><p>
All functions on this callback list are called when the
<code class="function">NotifyThumb</code> action is invoked. See the <code class="function">Scrollbar
Actions</code> section for details.
</p></td></tr><tr><td><p><span class="term">
<code class="function">length</code>
</span></p></td><td><p>
The height of a vertical scrollbar or the width of a horizontal scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">minimumThumb</code>
</span></p></td><td><p>
The smallest size, in pixels, to which the thumb can shrink.
</p></td></tr><tr><td><p><span class="term">
<code class="function">orientation</code>
</span></p></td><td><p>
The orientation is the direction that the thumb will be allowed to move.
This value can be either <code class="function">XtorientVertical</code> or
<code class="function">XtorientHorizontal</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollDCursor</code>
</span></p></td><td><p>
This cursor is used when scrolling backward in a vertical scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollHCursor</code>
</span></p></td><td><p>
This cursor is used when a horizontal scrollbar is inactive.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollLCursor</code>
</span></p></td><td><p>
This cursor is used when scrolling forward in a horizontal scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollProc</code>
</span></p></td><td><p>
All functions on this callback list may be called when the
<code class="function">NotifyScroll</code> action is invoked. See the \fBScrollbar
Actions\fP section for details.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollRCursor</code>
</span></p></td><td><p>
This cursor is used when scrolling backward in a horizontal scrollbar,
or when thumbing a vertical scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollUCursor</code>
</span></p></td><td><p>
This cursor is used when scrolling forward in a vertical scrollbar, or when
thumbing a horizontal scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">scrollVCursor</code>
</span></p></td><td><p>
This cursor is used when a vertical scrollbar is inactive.
</p></td></tr><tr><td><p><span class="term">
<code class="function">shown</code>
</span></p></td><td><p>
This is the size of the thumb, expressed as a percentage (0.0 - 1.0)
of the length of the scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">thickness</code>
</span></p></td><td><p>
The width of a vertical scrollbar or the height of a horizontal scrollbar.
</p></td></tr><tr><td><p><span class="term">
<code class="function">thumb</code>
</span></p></td><td><p>
This pixmap is used to tile (or stipple) the thumb of the scrollbar. If
no tiling is desired, then set this resource to <code class="function">None</code>. This
resource will accept either a bitmap or a pixmap that is the same depth
as the window. The resource converter for this resource constructs
bitmaps from the contents of files. (See <code class="function">Converting Bitmaps</code> for
details.)
</p></td></tr><tr><td><p><span class="term">
<code class="function">topOfThumb</code>
</span></p></td><td><p>
The location of the top of the thumb, as a percentage (0.0 - 1.0)
of the length of the scrollbar. This resource was called <code class="function">top</code> in
previous versions of the Athena widget set. The name collided with the
a Form widget constraint resource, and had to be changed.
</p></td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Scrollbar_Actions"></a>Scrollbar Actions</h3></div></div></div><p>
The actions supported by the Scrollbar widget are:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">StartScroll</code>(<span class="emphasis"><em>value</em></span>)
</span></p></td><td><p>
The possible <span class="emphasis"><em>values</em></span> are Forward, Backward, or Continuous.
This must be the first action to begin a new movement.
</p></td></tr><tr><td><p><span class="term">
<code class="function">NotifyScroll</code>(<span class="emphasis"><em>value</em></span>)
</span></p></td><td><p>
The possible <span class="emphasis"><em>values</em></span> are Proportional or FullLength. If the
argument to StartScroll was Forward or Backward, NotifyScroll executes
the <code class="function">scrollProc</code> callbacks and passes either; the position of the
pointer, if <span class="emphasis"><em>value</em></span> is Proportional, or the full length of the
scroll bar, if <span class="emphasis"><em>value</em></span> is FullLength. If the argument to
StartScroll was Continuous, NotifyScroll returns without executing any
callbacks.
</p></td></tr><tr><td><p><span class="term">
<code class="function">EndScroll</code>(\^)
</span></p></td><td><p>
This must be the last action after a movement is complete.
</p></td></tr><tr><td><p><span class="term">
<code class="function">MoveThumb</code>(\^)
</span></p></td><td><p>
Repositions the Scrollbar's thumb to the current pointer location.
</p></td></tr><tr><td><p><span class="term">
<code class="function">NotifyThumb</code>(\^)\
</span></p></td><td><p>
Calls the
callbacks and passes the relative position of the
pointer as a percentage of the scroll bar length.
</p></td></tr></tbody></table></div><p>
The default bindings for Scrollbar are:
</p><pre class="literallayout">
<Btn1Down>: StartScroll(Forward)
<Btn2Down>: StartScroll(Continuous) MoveThumb(\|) NotifyThumb(\|)
<Btn3Down>: StartScroll(Backward)
<Btn2Motion>: MoveThumb(\|) NotifyThumb(\|)
<BtnUp>: NotifyScroll(Proportional) EndScroll(\|)
</pre><p>
Examples of additional bindings a user might wish to specify in a
resource file are:
</p><pre class="literallayout">
*Scrollbar.Translations: \\
~Meta<Key>space: StartScroll(Forward) NotifyScroll(FullLength) \\n\\
Meta<Key>space: StartScroll(Backward) NotifyScroll(FullLength) \\n\\
EndScroll(\|)
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Scrollbar_Callbacks"></a>Scrollbar Callbacks</h3></div></div></div><p>
There are two callback lists provided by the Scrollbar widget.
The procedural interface for these functions is described here.
</p><p>
The calling interface to the <code class="function">scrollProc</code> callback procedure is:
</p><div class="funcsynopsis"><a id="ScrollProc"></a><p><code class="funcdef">void<strong class="fsfunc"> ScrollProc</strong>(</code>Widget<var class="pdparam"> scrollbar</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> position</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>scrollbar</em></span>
</span></p></td><td><p>
Specifies the Scrollbar widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies the client data.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>position</em></span>
</span></p></td><td><p>
Specifies a pixel position in integer form.
</p></td></tr></tbody></table></div><p>
The <code class="function">scrollProc</code> callback is used for incremental scrolling
and is called by the <code class="function">NotifyScroll</code> action.
The position argument is a signed quantity and should be cast to an int
when used. Using the default button bindings, button 1 returns a
positive value, and button 3 returns a negative value. In both cases,
the magnitude of the value is the distance of the pointer in
pixels from the top (or left) of the Scrollbar. The value will never
be greater than the length of the Scrollbar.
</p><p>
The calling interface to the <code class="function">jumpProc</code> callback procedure is:
</p><div class="funcsynopsis"><a id="JumpProc"></a><p><code class="funcdef">void<strong class="fsfunc"> JumpProc</strong>(</code>Widget<var class="pdparam"> scrollbar</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> percent_ptr</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>scrollbar</em></span>
</span></p></td><td><p>
Specifies the ID of the scroll bar widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies the client data.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>percent_ptr</em></span>
</span></p></td><td><p>
Specifies the floating point position of the thumb (0.0 \- 1.0).
</p></td></tr></tbody></table></div><p>
The <code class="function">jumpProc</code> callback is used to implement smooth scrolling and
is called by the <code class="function">NotifyThumb</code> action. Percent_ptr must be cast
to a pointer to float before use; i.e.
</p><pre class="literallayout">
float percent = *(float*)percent_ptr;
</pre><p>
With the default button bindings, button 2 moves the thumb interactively,
and the <code class="function">jumpProc</code> is called on each new position of the pointer,
while the pointer button remains down. The value specified by
<span class="emphasis"><em>percent_ptr</em></span> is the current location of the thumb (from the top or
left of the Scrollbar) expressed as a percentage of the length of the
Scrollbar.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
To set the position and length of a Scrollbar thumb, use
</p><div class="funcsynopsis"><a id="XawScrollbarSetThumb"></a><p><code class="funcdef">void<strong class="fsfunc"> XawScrollbarSetThumb</strong>(</code>Widget<var class="pdparam"> w</var>, float<var class="pdparam"> top</var>, float<var class="pdparam"> shown</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Scrollbar widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>top</em></span>
</span></p></td><td><p>
Specifies the position of the top of the thumb as a fraction of the
length of the Scrollbar.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>shown</em></span>
</span></p></td><td><p>
Specifies the length of the thumb as a fraction of the total length
of the Scrollbar.
</p></td></tr></tbody></table></div><p>
<code class="function">XawScrollbarThumb</code>
moves the visible thumb to a new position (0.0 \- 1.0) and length (0.0 \- 1.0).
Either the top or shown arguments can be specified as \-1.0,
in which case the current value is left unchanged.
Values greater than 1.0 are truncated to 1.0.
</p><p>
If called from <code class="function">jumpProc</code>, <a class="xref" href="#XawScrollbarSetThumb"><code class="function"> XawScrollbarSetThumb</code></a> has no effect.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Setting_Float_Resources"></a>Setting Float Resources</h3></div></div></div><p>
The <code class="function">shown</code> and <code class="function">topOfThumb</code> resources are of type
<span class="emphasis"><em>float</em></span>. These resources can be difficult to get into an
argument list. The reason is that C performs an automatic cast of
the float value to an integer value, usually truncating the important
information. The following code fragment is one portable method of
getting a float into an argument list.
</p><pre class="literallayout">
top = 0.5;
if (sizeof(float) > sizeof(XtArgVal)) {
/*
\ * If a float is larger than an XtArgVal then pass this
\ * resource value by reference.
\ */
XtSetArg(args[0], XtNshown, &top);
}
else {
/*
\ * Convince C not to perform an automatic conversion, which
\ * would truncate 0.5 to 0.
\ */
XtArgVal * l_top = (XtArgVal *) &top;
XtSetArg(args[0], XtNshown, *l_top);
}
</pre></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Simple_Widget"></a>Simple Widget</h2></div></div></div><pre class="literallayout">
Application Header file <Xaw/Simple.h>
Class Header file <Xaw/SimpleP.h>
Class simpleWidgetClass
Class Name Simple
Superclass Core
</pre><p>
The Simple widget is not very useful by itself, as it has no semantics
of its own. It main purpose is to be used as a common superclass for
the other <span class="emphasis"><em>simple</em></span> Athena widgets. This widget adds six resources
to the resource list provided by the Core widget and its superclasses.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Simple::Resources"></a>Resources</h3></div></div></div><p>
When creating a Simple widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="StripChart_Widget"></a>StripChart Widget</h2></div></div></div><pre class="literallayout">
Application Header file <Xaw/StripChart.h>
Class Header file <Xaw/StripCharP.h>
Class stripChartWidgetClass
Class Name StripChart
Superclass Simple
</pre><p>
The StripChart widget is used to provide a roughly real
time graphical chart of a single value. For example,
it is used by the common client program <code class="function">xload</code>
to provide a graph of processor load. The StripChart
reads data from an application, and updates the chart
at the <code class="function">update</code> interval specified.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="StripChart::Resources"></a>Resources</h3></div></div></div><p>
When creating a StripChart widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">getValue</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">120</td></tr><tr><td align="center">highlight</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">jumpScroll</td><td align="center">JumpScroll</td><td align="center">int</td><td align="center">A</td><td align="center">half the width of the widget</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">minScale</td><td align="center">Scale</td><td align="center">int</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Pointer</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">update</td><td align="center">Interval</td><td align="center">int</td><td align="center"> </td><td align="center">10</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">120</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">foreground</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
that will be used to draw the graph.
</p></td></tr><tr><td><p><span class="term">
<code class="function">getValue</code>
</span></p></td><td><p>
A list of callback functions to call every <code class="function">update</code> seconds.
This list should contain one function, which returns the
value to be graphed by the StripChart widget. The following
section describes the procedural interface. Behavior when this list has
more than one function is undefined.
</p></td></tr><tr><td><p><span class="term">
<code class="function">highlight</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the color
that will be used to draw the scale lines on the graph.
</p></td></tr><tr><td><p><span class="term">
<code class="function">jumpScroll</code>
</span></p></td><td><p>
When the graph reaches the right edge of the window it must be
scrolled to the left. This resource specifies the number of pixels
it will jump. Smooth scrolling can be achieved by setting this resource
to 1.
</p></td></tr><tr><td><p><span class="term">
<code class="function">minScale</code>
</span></p></td><td><p>
The minimum scale for the graph. The number of divisions on the graph
will always be greater than or equal to this value.
</p></td></tr><tr><td><p><span class="term">
<code class="function">update</code>
</span></p></td><td><p>
The number of seconds between graph updates. Each update is
represented on the graph as a 1 pixel wide line. Every <code class="function">update</code> seconds
the <code class="function">getValue</code> procedure will be used to get a new graph point,
and this point will be added to the right end of the StripChart.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Getting_the_StripChart_Value"></a>Getting the StripChart Value</h3></div></div></div><p>
The StripChart widget will call the application routine passed to it
as the <code class="function">getValue</code> callback function every <code class="function">update</code> seconds to
obtain another point for the StripChart graph.
</p><p>
The calling interface for the <code class="function">getValue</code> callback is:
</p><div class="funcsynopsis"><p><code class="funcdef"><strong class="fsfunc"> void</strong>(*getValueProc)(</code>Widget<var class="pdparam"> w</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> value</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the StripChart widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies the client data.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>value</em></span>
</span></p></td><td><p>
Returns a pointer to a double. The application should set the address
pointed to by this argument to a double containing the value to be
graphed on the StripChart.
</p></td></tr></tbody></table></div><p>
</p><p>
This function is used by the StripChart to call an application routine.
The routine will pass the value to be graphed back to the the StripChart
in the <code class="function">value</code> field of this routine.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Toggle_Widget"></a>Toggle Widget</h2></div></div></div><pre class="literallayout">
Application Header file <Xaw/Toggle.h>
Class Header file <Xaw/ToggleP.h>
Class toggleWidgetClass
Class Name Toggle
Superclass Command
</pre><p>
The Toggle widget is an area, often rectangular,
that displays a graphic. The graphic may be a text
string containing multiple lines of characters in an 8
bit or 16 bit character set (to be displayed with a
<span class="emphasis"><em>font</em></span>), or in a multi-byte encoding (for use with
a <span class="emphasis"><em>fontset</em></span>). The graphic may also be a bitmap or
pixmap.
</p><p>
This widget maintains a Boolean state (e.g.
True/False or On/Off) and changes state whenever it is selected. When
the pointer is on the Toggle widget, the Toggle widget may become highlighted by
drawing a rectangle around its perimeter. This highlighting indicates
that the Toggle widget is ready for selection. When pointer button 1 is
pressed and released, the Toggle widget indicates that it has changed
state by reversing its foreground and background colors, and its
<code class="function">notify</code> action is invoked, calling all functions on its callback
list. If the pointer is moved off of the widget before the pointer button is
released, the Toggle widget reverts to its previous foreground and background
colors, and releasing the pointer button has no effect. This behavior allows
the user to cancel the operation.
</p><p>
Toggle widgets may also be part of a ``radio group.'' A radio group is a
list of at least two Toggle widgets in which no more than one Toggle may
be set at
any time. A radio group is identified by the widget ID of any one of
its members. The convenience routine <a class="xref" href="#XawToggleGetCurrent"><code class="function"> XawToggleGetCurrent</code></a> will
return information about the Toggle widget in the radio group.
</p><p>
Toggle widget state is preserved across changes in sensitivity.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Toggle::Resources"></a>Resources</h3></div></div></div><p>
When creating a Toggle widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">bitmap</td><td align="center">Bitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cornerRoundPercent</td><td align="center">CornerRoundPercent</td><td align="center">Dimension</td><td align="center"> </td><td align="center">25</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">encoding</td><td align="center">Encoding</td><td align="center">UnsignedChar</td><td align="center"> </td><td align="center">XawTextEncoding8bit</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic height + 2 * <code class="function">internalHeight</code></td></tr><tr><td align="center">highlightThickness</td><td align="center">Thickness</td><td align="center">Dimension</td><td align="center">A</td><td align="center">2 (0 if Shaped)</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">internalHeight</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">internalWidth</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">justify</td><td align="center">Justify</td><td align="center">Justify</td><td align="center"> </td><td align="center">XtJustifyCenter (center)</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">name of widget</td></tr><tr><td align="center">leftBitmap</td><td align="center">LeftBitmap</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">radioData</td><td align="center">RadioData</td><td align="center">Pointer</td><td align="center"> </td><td align="center">Name of widget</td></tr><tr><td align="center">radioGroup</td><td align="center">Widget</td><td align="center">Widget</td><td align="center"> </td><td align="center">No radio group</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">shapeStype</td><td align="center">ShapeStyle</td><td align="center">ShapeStyle</td><td align="center"> </td><td align="center">Rectangle</td></tr><tr><td align="center">state</td><td align="center">State</td><td align="center">Boolean</td><td align="center"> </td><td align="center">Off</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See below</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">graphic width + 2 * <code class="function">internalWidth</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">radioData</code>
</span></p></td><td><p>
Specifies the data that will be returned by <a class="xref" href="#XawToggleGetCurrent"><code class="function"> XawToggleGetCurrent</code></a>
when this is the currently <span class="emphasis"><em>set</em></span> widget in the radio group. This
value is also used to identify the Toggle that will be set by a call to
<a class="xref" href="#XawToggleSetCurrent"><code class="function"> XawToggleSetCurrent</code></a>. The value NULL will be returned by
<a class="xref" href="#XawToggleGetCurrent"><code class="function"> XawToggleGetCurrent</code></a> if no widget in a radio group is currently
set. Programmers must not specify NULL (or Zero) as <code class="function">radioData</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">radioGroup</code>
</span></p></td><td><p>
Specifies another Toggle widget that is in the radio group to which this
Toggle widget should be added. A radio group is a group of at least two Toggle
widgets, only one of which may be <span class="emphasis"><em>set</em></span> at a time. If this value is
NULL (the default) then the Toggle will not be part of any radio group
and can change state without affecting any other Toggle widgets. If the
widget specified in this resource is not already in a radio group then a
new radio group will be created containing these two Toggle widgets. No
Toggle widget can be in multiple radio groups. The behavior of a radio
group of one toggle is undefined. A converter is registered which will
convert widget names to widgets without caching.
</p></td></tr><tr><td><p><span class="term">
<code class="function">state</code>
</span></p></td><td><p>
Specifies whether the Toggle widget is set (<code class="function">True</code>) or unset
(<code class="function">False</code>).
</p></td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Toggle_Actions"></a>Toggle Actions</h3></div></div></div><p>
The Toggle widget supports the following actions:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Switching the Toggle widget between the foreground and background
colors with <code class="function">set</code> and <code class="function">unset</code> and <code class="function">toggle</code>
</p></li><li class="listitem"><p>
Processing application callbacks with <code class="function">notify</code>
</p></li><li class="listitem"><p>
Switching the internal border between highlighted
and unhighlighted states with <code class="function">highlight</code> and <code class="function">unhighlight</code>
</p></li></ul></div><p>
The following are the default translation bindings used by the
Toggle widget:
</p><pre class="literallayout">
<EnterWindow>: highlight(Always)
<LeaveWindow>: unhighlight()
<Btn1Down>,<Btn1Up>: toggle() notify()
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Toggle_Actions_b"></a>Toggle Actions</h3></div></div></div><p>
The full list of actions supported by Toggle is:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">highlight</code>(<span class="emphasis"><em>condition</em></span>)
</span></p></td><td><p>
Displays the internal highlight border in the color (<code class="function">foreground</code>
or <code class="function">background</code> ) that contrasts with the interior color of the
Toggle widget. The conditions <code class="function">WhenUnset</code> and <code class="function">Always</code> are
understood by this action procedure. If no argument is passed then
<code class="function">WhenUnset</code> is assumed.
</p></td></tr><tr><td><p><span class="term">
<code class="function">unhighlight</code>()
</span></p></td><td><p>
Displays the internal highlight border in the color (<code class="function">foreground</code>
or <code class="function">background</code> ) that matches the interior color of the
Toggle widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">set</code>()
</span></p></td><td><p>
Enters the <span class="emphasis"><em>set</em></span> state, in which <code class="function">notify</code> is possible. This
action causes the Toggle widget to display its interior in the
<code class="function">foreground</code> color. The label or bitmap is displayed in the
<code class="function">background</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">unset</code>()
</span></p></td><td><p>
Cancels the <span class="emphasis"><em>set</em></span> state and displays the interior of the Toggle widget in the
<code class="function">background</code> color. The label or bitmap is displayed in the
<code class="function">foreground</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">toggle</code>()
</span></p></td><td><p>
Changes the current state of the Toggle widget, causing to be set
if it was previously unset, and unset if it was previously set.
If the widget is to be set, and is in a radio group then this procedure may
unset another Toggle widget causing all routines on its callback list
to be invoked. The callback routines for the Toggle that
is to be unset will be called before the one that is to be set.
</p></td></tr><tr><td><p><span class="term">
<code class="function">reset</code>()
</span></p></td><td><p>
Cancels any <code class="function">set</code> or <code class="function">highlight</code> and displays the interior of the
Toggle widget in the <code class="function">background</code> color, with the label displayed in the
<code class="function">foreground</code> color.
</p></td></tr><tr><td><p><span class="term">
<code class="function">notify</code>()
</span></p></td><td><p>
When the Toggle widget is in the <code class="function">set</code> state this action calls all functions in
the callback list named by the <code class="function">callback</code> resource. The value of
the call_data argument in these callback functions is undefined.
</p></td></tr></tbody></table></div><p>
When a bitmap of depth greater that one (1) is specified the
<span class="emphasis"><em>set</em></span>(), <span class="emphasis"><em>unset</em></span>(), and <span class="emphasis"><em>reset</em></span>() actions have no effect,
since there are no foreground and background colors used in a
multi-plane pixmap.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Radio_Groups"></a>Radio Groups</h3></div></div></div><p>
There are typically two types of radio groups desired by applications.
The default translations for the Toggle widget implement a "zero or one
of many" radio group. This means that there may be no more than one
Toggle widget active, but there need not be any Toggle widgets active.
</p><p>
The other type of radio group is "one of many" and has the more strict
policy that there will always be exactly one radio button active.
Toggle widgets can be used to provide this interface with a slight
modification to the translation table of each Toggle in the group.
</p><pre class="literallayout">
<EnterWindow>: highlight(Always)
<LeaveWindow>: unhighlight()
<Btn1Down>,<Btn1Up>: set() notify()
</pre><p>
This translation table will not allow any Toggle to be <span class="emphasis"><em>unset</em></span>
except as a result of another Toggle becoming <span class="emphasis"><em>set</em></span>. It is
the application programmer's responsibility to choose an initial
state for the radio group by setting the <code class="function">state</code> resource of one of
its member widgets to <code class="function">True</code>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Toggle::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
The following functions allow easy access to the Toggle widget's radio
group functionality.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Changing_the_Toggles_Radio_Group"></a>Changing the Toggle's Radio Group.</h4></div></div></div><p>
To enable an application to change the Toggle's radio group, add
the Toggle to a radio group, or remove the Toggle from a radio group, use
<a class="xref" href="#XawToggleChangeRadioGroup"><code class="function"> XawToggleChangeRadioGroup</code></a>.
</p><div class="funcsynopsis"><a id="XawToggleChangeRadioGroup"></a><p><code class="funcdef">void<strong class="fsfunc"> XawToggleChangeRadioGroup</strong>(</code>Widgetw,<var class="pdparam"> radio_group</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Toggle widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>radio_group</em></span>
</span></p></td><td><p>
Specifies any Toggle in the new radio group. If NULL then the Toggle
will be removed from any radio group of which it is a member.
</p></td></tr></tbody></table></div><p>
</p><p>
If a Toggle is already <span class="emphasis"><em>set</em></span> in the new radio group,
and the Toggle to be added is also <span class="emphasis"><em>set</em></span> then the previously
<span class="emphasis"><em>set</em></span> Toggle in the radio group is <span class="emphasis"><em>unset</em></span> and its callback
procedures are invoked.
Finding the Currently selected Toggle in a radio group of Toggles
</p><p>
To find the currently selected Toggle in a radio group of Toggle widgets
use <a class="xref" href="#XawToggleGetCurrent"><code class="function"> XawToggleGetCurrent</code></a>.
</p><div class="funcsynopsis"><a id="XawToggleGetCurrent"></a><p><code class="funcdef">XtPointer<strong class="fsfunc"> XawToggleGetCurrent</strong>(</code>XtPointer<var class="pdparam"> XawToggleGetCurrent(radio_group)</var>, Widget<var class="pdparam"> radio_group</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>radio_group</em></span>
</span></p></td><td><p>
Specifies any Toggle widget in the radio group.
</p></td></tr></tbody></table></div><p>
The value returned by this function is the
<code class="function">radioData</code>
of the Toggle in this radio group that is currently set. The default
value for <code class="function">radioData</code>
is the name of that Toggle widget. If no Toggle is set in the radio
group specified then NULL is returned.
Changing the Toggle that is set in a radio group.
</p><p>
To change the Toggle that is currently set in a radio group use
<a class="xref" href="#XawToggleSetCurrent"><code class="function"> XawToggleSetCurrent</code></a>.
</p><div class="funcsynopsis"><a id="XawToggleSetCurrent"></a><p><code class="funcdef">void<strong class="fsfunc"> XawToggleSetCurrent</strong>(</code>voidXawToggleSetCurrent(radio_group,<var class="pdparam"> radio_data)</var>, Widget<var class="pdparam"> radio_group</var>, XtPointer<var class="pdparam"> radio_data</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>radio_group</em></span>
</span></p></td><td><p>
Specifies any Toggle widget in the radio group.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>radio_data</em></span>
</span></p></td><td><p>
Specifies the
<code class="function">radioData</code>
identifying the Toggle that should be set in the radio group specified
by the <span class="emphasis"><em>radio_group</em></span> argument.
</p></td></tr></tbody></table></div><p>
<a class="xref" href="#XawToggleSetCurrent"><code class="function"> XawToggleSetCurrent</code></a> locates the Toggle widget to be set by
matching <span class="emphasis"><em>radio_data</em></span> against the <code class="function">radioData</code> for each Toggle in
the radio group. If none match, <a class="xref" href="#XawToggleSetCurrent"><code class="function"> XawToggleSetCurrent</code></a> returns
without making any changes. If more than one Toggle matches,
<a class="xref" href="#XawToggleSetCurrent"><code class="function"> XawToggleSetCurrent</code></a> will choose a Toggle to set arbitrarily. If
this causes any Toggle widgets to change state, all routines in their
callback lists will be invoked. The callback routines for a Toggle that
is to be unset will be called before the one that is to be set.
Unsetting all Toggles in a radio group.
</p><p>
To unset all Toggle widgets in a radio group use
<a class="xref" href="#XawToggleUnsetCurrent"><code class="function"> XawToggleUnsetCurrent</code></a>.
</p><div class="funcsynopsis"><a id="XawToggleUnsetCurrent"></a><p><code class="funcdef">void<strong class="fsfunc"> XawToggleUnsetCurrent</strong>(</code>void<var class="pdparam"> XawToggleUnsetCurrent(radio_group)</var>, Widget<var class="pdparam"> radio_group</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>radio_group</em></span>
</span></p></td><td><p>
Specifies any Toggle widget in the radio group.
</p></td></tr></tbody></table></div><p>
If this causes a Toggle widget to change state, all routines on its
callback list will be invoked.
</p></div></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Menus"></a>Chapter 4. Menus</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Using_the_Menus">Using the Menus</a></span></dt><dt><span class="sect1"><a href="#Sme_Object">Sme Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Sme::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_Sme_Object">Subclassing the Sme Object</a></span></dt></dl></dd><dt><span class="sect1"><a href="#SmeBSB_Object">SmeBSB Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#SmeBSB::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#SmeLine_Object">SmeLine Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#SmeLine::Resources">Resources</a></span></dt></dl></dd></dl></div><p>
The Athena widget set provides support for single paned non-hierarchical
popup and pulldown menus. Since menus are such a common user interface
tool, support for them must be provided in even the most basic widget
sets. In menuing as in other areas, the Athena Widget Set provides only
basic functionality.
</p><p>
Menus in the Athena widget set are implemented as a menu container (the
SimpleMenu widget) and a collection of objects that comprise the
menu entries. The SimpleMenu widget is itself a direct subclass of the
OverrideShell widget class, so no other shell is necessary when
creating a menu. The managed children of a SimpleMenu must be
subclasses of the Sme (Simple Menu Entry) object.
</p><p>
The Athena widget set provides three classes of Sme objects that may be
used to build menus.
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">Sme</span></p></td><td><p>
The base class of all menu entries. It may be used as a menu entry
itself to provide blank space in a menu. "Sme" means "Simple Menu
Entry."
</p></td></tr><tr><td><p><span class="term">SmeBSB</span></p></td><td><p>
This menu entry provides a selectable entry containing a text string.
A bitmap may also be placed in the left and right margins. "BSB" means
"Bitmap String Bitmap."
</p></td></tr><tr><td><p><span class="term">SmeLine</span></p></td><td><p>
This menu entry provides an unselectable entry containing a separator line.
</p></td></tr></tbody></table></div><p>
</p><p>
The SimpleMenu widget informs the window manager that it should ignore
its window by setting the <code class="function">Override Redirect</code> flag. This is the
correct behavior for the press-drag-release style of menu operation. If
click-move-click or "pinable" menus are desired it is the
responsibility of the application programmer, using the SimpleMenu
resources, to inform the window manager of the menu.
</p><p>
To allow easy creation of pulldown menus, a MenuButton widget is
also provided as part of the Athena widget set.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Using_the_Menus"></a>Using the Menus</h2></div></div></div><p>
The default configuration for the menus is press-drag-release.
The menus will typically be
activated by clicking a pointer button while the pointer is over a
MenuButton, causing the menu to appear in a fixed location relative to
that button; this is a <code class="function">pulldown</code> menu. Menus may also be activated
when a specific pointer and/or key sequence is used anywhere in the
application; this is a <code class="function">popup</code> menu (e.g. clicking Ctrl-<pointer
button 1> in the common application <code class="function">xterm</code>). In this
case the menu should be positioned under
the cursor. Typically menus will be placed so the pointer cursor is on
the first menu entry, or the last entry selected by the user.
</p><p>
The menu remains on the screen as long as the pointer button is held
down. Moving the pointer will highlight different menu items.
If the pointer leaves the menu, or moves over an entry that cannot
be selected then no menu entry will highlighted. When the desired menu
entry has been highlighted, releasing the pointer button removes the menu,
and causes any mechanism associated with this entry to be invoked.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Sme_Object"></a>Sme Object</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Sme.h>
Class Header file <X11/Xaw/SmeP.h>
Class smeObjectClass
Class Name Sme
Superclass RectObj
</pre><p>
</p><p>
The Sme object is the base class for all menu entries. While this
object is mainly intended to be subclassed, it may be used in a menu to
add blank space between menu entries.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Sme::Resources"></a>Resources</h3></div></div></div><p>
The resources associated with the SmeLine object are defined in this
section, and affect only the single menu entry specified by this object.
There are no new resources added for this class, as it picks up all its
resources from the RectObj class.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr></tbody></table></div><p>
Keep in mind that the SimpleMenu widget will force all menu items to
be the width of the widest entry.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Subclassing_the_Sme_Object"></a>Subclassing the Sme Object</h3></div></div></div><p>
To Create a new Sme object <span class="emphasis"><em>class</em></span> you will need to define three class methods.
These methods allow the SimpleMenu to highlight and unhighlight the
menu entry as the pointer cursor moves over it, as well as notify the
entry when the user has selected it. All of
these methods may be inherited from the Sme object, although the default
semantics are not very interesting.
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Highlight</code>(\|)
</span></p></td><td><p>
Called to put the menu entry into the highlighted state.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Unhighlight</code>(\|)
</span></p></td><td><p>
Called to return the widget to its normal (unhighlighted) state.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Notify</code>(\|)
</span></p></td><td><p>
Called when the user selects this menu entry.
</p></td></tr></tbody></table></div><p>
</p><p>
Other then these methods, creating a new object
is straight forward. Here is some information that may help you
avoid some common mistakes.
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Objects can be zero pixels high.</p></li><li class="listitem"><p>
Objects draw on their parent's window, therefore the Drawing dimensions
are different from those of widgets. For instance, y locations vary
from <code class="function">y</code> to <code class="function">y + height</code>, not <code class="function">0</code> to <code class="function">height</code>.
</p></li><li class="listitem"><p>
XtSetValues calls may come from the application while the Sme is highlighted,
and if the SetValues method returns True, will result in an expose event.
The SimpleMenu may later call the menu entry's <code class="function">unhighlight</code>
procedure. However, due to the asynchronous nature of
X, the expose event generated by <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a> will come <span class="emphasis"><em>after</em></span>
this unhighlight.
</p></li><li class="listitem"><p>
Remember that your subclass of the Sme does not own the
window. Share the space with other menu entries, and refrain
from drawing outside the subclass's own section of the menu.
</p></li></ol></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="SmeBSB_Object"></a>SmeBSB Object</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/SmeBSB.h>
Class Header file <X11/Xaw/SmeBSBP.h>
Class smeBSBObjectClass
Class Name SmeBSB
Superclass Sme
</pre><p>
</p><p>
The SmeBSB object is used to create a menu entry that contains a string,
and optional bitmaps in its left and right margins. Since each menu
entry is an independent object, the application is able to change the
font, color, height, and other attributes of the menu entries, on an
entry by entry basis. The format of the string may either be the encoding
of the 8 bit <code class="function">font</code> utilized, or in a multi-byte encoding for use with a
<code class="function">fontSet</code>.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="SmeBSB::Resources"></a>Resources</h3></div></div></div><p>
The resources associated with the SmeBSB object are defined in this section,
and affect only the single menu entry specified by this object.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">FontStruct</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Font height + <code class="function">vertSpace</code></td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">justify</td><td align="center">Justify</td><td align="center">Justify</td><td align="center"> </td><td align="center">XtjustifyLeft</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">leftBitmap</td><td align="center">LeftBitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">leftMargin</td><td align="center">leftMargin</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">rightBitmap</td><td align="center">RightBitmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">rightMargin</td><td align="center">rightMargin</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">vertSpace</td><td align="center">VertSpace</td><td align="center">int</td><td align="center"> </td><td align="center">25</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">TextWidth + margins</td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">callback</span></p></td><td><p>
All callback functions on this list are called when the SimpleMenu
<span class="emphasis"><em>notifies</em></span> this entry that the user has selected it.
</p></td></tr><tr><td><p><span class="term">font</span></p></td><td><p>
The text font to use when displaying the <code class="function">label</code>, when the
<code class="function">international</code> resource is <code class="function">false</code>.
</p></td></tr><tr><td><p><span class="term">fontSet</span></p></td><td><p>
The text font set to use when displaying the <code class="function">label</code>, when the
<code class="function">international</code> resource is <code class="function">true</code>.
</p></td></tr><tr><td><p><span class="term">foreground</span></p></td><td><p>
A pixel value which indexes the SimpleMenu's colormap to derive the
foreground color of the menu entry's window. This color is also
used to render all 1's in the left and right <code class="function">bitmaps</code>.
Keep in mind that the SimpleMenu widget will force the width of all
menu entries to be the width of the longest entry.
</p></td></tr><tr><td><p><span class="term">justify</span></p></td><td><p>
How the label is to be rendered between the left and right margins when
the space is wider than the actual text. This resource may be
specified with the values <code class="function">XtJustifyLeft</code>, <code class="function">XtJustifyCenter</code>,
or <code class="function">XtJustifyRight</code>. When specifying the justification from a
resource file the values <code class="function">left</code>, <code class="function">center</code>, or <code class="function">right</code> may be
used.
</p></td></tr><tr><td><p><span class="term">label</span></p></td><td><p>
This is a the string that will be displayed in the menu entry. The
exact location of this string within the bounds of the menu entry is
controlled by the <code class="function">leftMargin</code>, <code class="function">rightMargin</code>, <code class="function">vertSpace</code>,
and <code class="function">justify</code> resources.
</p></td></tr><tr><td><p><span class="term">leftBitmap</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">rightBitmap</span></p></td><td><p>
This is a name of a bitmap to display in the left or right margin of the
menu entry. All 1's in the bitmap will be rendered in the foreground
color, and all 0's will be drawn in the background color of the
SimpleMenu widget. It is the
programmers' responsibility to make sure that the menu entry is tall
enough, and the appropriate margin wide enough to accept the bitmap.
If care is not taken the bitmap may extend into another menu entry, or
into this entry's label.
</p></td></tr><tr><td><p><span class="term">leftMargin</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">rightMargin</span></p></td><td><p>
This is the amount of space (in pixels) that will be left between the
edge of the menu entry and the label string.
</p></td></tr><tr><td><p><span class="term">vertSpace</span></p></td><td><p>
This is the amount of vertical padding, expressed as a percentage of
the height of the font, that is to be placed around the label of a
menu entry.. The label and bitmaps are always centered vertically
within the menu. The default value for this
resource (25) causes the default height to be 125% of the height of the
font.
</p></td></tr></tbody></table></div><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="SmeLine_Object"></a>SmeLine Object</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/SmeLine.h>
Class Header file <X11/Xaw/SmeLineP.h>
Class smeLineObjectClass
Class Name SmeLine
Superclass Sme
</pre><p>
</p><p>
The SmeLine object is used to add a horizontal line or menu separator to
a menu. Since each SmeLine is an independent object, the application
is able to change the color, height, and other attributes of the SmeLine
objects on an entry by entry basis. This object is not selectable, and
will not highlight when the pointer cursor is over it.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="SmeLine::Resources"></a>Resources</h3></div></div></div><p>
The resources associated with the SmeLine object are defined in this section,
and affect only the single menu entry specified by this object.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center"><code class="function">lineWidth</code></td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">lineWidth</td><td align="center">LineWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">stipple</td><td align="center">Stipple</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">foreground</span></p></td><td><p>
A pixel value which indexes the SimpleMenu's colormap to derive the
foreground color used to draw the separator line.
Keep in mind that the SimpleMenu widget will force all menu items to
be the width of the widest entry. Thus, setting the width is generally not
very important.
</p></td></tr><tr><td><p><span class="term">lineWidth</span></p></td><td><p>
The width of the horizontal line that is to be displayed.
</p></td></tr><tr><td><p><span class="term">stipple</span></p></td><td><p>
If a bitmap is specified for this resource, the line will be stippled
through it. This allows the menu separator to be rendered as something
more exciting than just a line. For instance, if you define a stipple
that is a chain link, then your menu separators will look like chains.
</p></td></tr></tbody></table></div><p>
</p></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Text_Widgets"></a>Chapter 5. Text Widgets</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Text_Widget_for_Users">Text Widget for Users</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Default_Key_Bindings">Default Key Bindings</a></span></dt><dt><span class="sect2"><a href="#Search_and_Replace">Search and Replace</a></span></dt><dt><span class="sect2"><a href="#File_Insertion">File Insertion</a></span></dt><dt><span class="sect2"><a href="#Text_Selections_for_Users">Text Selections for Users</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Text_Widget_Actions">Text Widget Actions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Cursor_Movement_Actions">Cursor Movement Actions\fP</a></span></dt><dt><span class="sect2"><a href="#Delete_Actions">Delete Actions</a></span></dt><dt><span class="sect2"><a href="#Selection_Actions">Selection Actions</a></span></dt><dt><span class="sect2"><a href="#The_New_Line_Actions">The New Line Actions</a></span></dt><dt><span class="sect2"><a href="#Kill_and_Actions">Kill and Actions</a></span></dt><dt><span class="sect2"><a href="#Miscellaneous_Actions">Miscellaneous Actions</a></span></dt><dt><span class="sect2"><a href="#Text_Selections_for_Application_Programmers">Text Selections for Application Programmers</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Default_Translation_Bindings">Default Translation Bindings</a></span></dt><dt><span class="sect1"><a href="#Text_Functions">Text Functions</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Selecting_Text">Selecting Text</a></span></dt><dt><span class="sect2"><a href="#Unhighlighting_Text">Unhighlighting Text</a></span></dt><dt><span class="sect2"><a href="#Getting_Current_Text_Selection">Getting Current Text Selection</a></span></dt><dt><span class="sect2"><a href="#Replacing_Text">Replacing Text</a></span></dt><dt><span class="sect2"><a href="#Searching_for_Text">Searching for Text</a></span></dt><dt><span class="sect2"><a href="#Redisplaying_Text">Redisplaying Text</a></span></dt><dt><span class="sect2"><a href="#Resources_Convenience_Routines">Resources Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Customizing_the_Text_Widget">Customizing the Text Widget</a></span></dt><dt><span class="sect1"><a href="#Text_Widget">Text Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Text::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#TextSink_Object">TextSink Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#TextSink::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_TextSink">Subclassing the TextSink</a></span></dt></dl></dd><dt><span class="sect1"><a href="#TextSrc_Object">TextSrc Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#TextSource::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Subclassing_the_TextSrc">Subclassing the TextSrc</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Sink_Object_and_Multi_Sink_Object">Ascii Sink Object and Multi Sink Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiSink::Resources">Resources</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Source_Object_and_Multi_Source_Object">Ascii Source Object and Multi Source Object</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiSource::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#AsciiSource::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Ascii_Text_Widget">Ascii Text Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#AsciiText::Resources">Resources</a></span></dt></dl></dd></dl></div><p>
The Text widget provides a window that will allow an application
to display and edit one or more lines of text. Options are provided to
allow the user to add Scrollbars to its window, search for a specific
string, and modify the text in the buffer.
</p><p>
The Text widget is made up of a number of pieces; it was modularized to
ease customization. The AsciiText widget class (actually not limited to
ASCII but so named for compatibility) is be general enough to most
needs. If more flexibility, special features, or extra functionality is
needed, they can be added by implementing a new TextSource or TextSink, or
by subclassing the Text Widget (See Section 5.8 for customization
details.)
</p><p>
The words <span class="emphasis"><em>insertion point</em></span> are used in this chapter to refer to the text
caret. This is the symbol that is displayed between two characters in
the file. The insertion point marks the location where any new characters
will be added to the file. To avoid confusion the pointer cursor will
always be referred to as the <span class="emphasis"><em>pointer</em></span>.
</p><p>
The text widget supports three edit modes, controlling the types of
modifications a user is allowed to make:
</p><p>
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>Append-only</p></li><li class="listitem"><p>Editable</p></li><li class="listitem"><p>Read-only</p></li></ul></div><p>
</p><p>
Read-only mode does not allow the user or the programmer to modify the text
in the widget. While the entire string may be reset in
read-only mode with <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>, it cannot be modified via
with <a class="xref" href="#XawTextReplace"><code class="function"> XawTextReplace</code></a>. Append-only and editable modes allow
the text at the insertion point to be modified. The only difference is
that text may only be added to or removed from the end of a buffer in
append-only mode.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Text_Widget_for_Users"></a>Text Widget for Users</h2></div></div></div><p>
The Text widget provides many of the common keyboard editing commands.
These commands allow users to move around and edit the buffer. If an
illegal operation is attempted, (such as deleting characters in a
read-only text widget), the X server will beep.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Default_Key_Bindings"></a>Default Key Bindings</h3></div></div></div><p>
The default key bindings are patterned after those in the EMACS text editor:
</p><pre class="literallayout">
Ctrl-a Beginning Of Line Meta-b Backward Word
Ctrl-b Backward Character Meta-f Forward Word
Ctrl-d Delete Next Character Meta-i Insert File
Ctrl-e End Of Line Meta-k Kill To End Of Paragraph
Ctrl-f Forward Character Meta-q Form Paragraph
Ctrl-g Multiply Reset Meta-v Previous Page
Ctrl-h Delete Previous Character Meta-y Insert Current Selection
Ctrl-j Newline And Indent Meta-z Scroll One Line Down
Ctrl-k Kill To End Of Line Meta-d Delete Next Word
Ctrl-l Redraw Display Meta-D Kill Word
Ctrl-m Newline Meta-h Delete Previous Word
Ctrl-n Next Line Meta-H Backward Kill Word
Ctrl-o Newline And Backup Meta-< Beginning Of File
Ctrl-p Previous Line Meta-> End Of File
Ctrl-r Search/Replace Backward Meta-] Forward Paragraph
Ctrl-s Search/Replace Forward Meta-[ Backward Paragraph
Ctrl-t Transpose Characters
Ctrl-u Multiply by 4 Meta-Delete Delete Previous Word
Ctrl-v Next Page Meta-Shift Delete Kill Previous Word
Ctrl-w Kill Selection Meta-Backspace Delete Previous Word
Ctrl-y Unkill Meta-Shift Backspace Kill Previous Word
Ctrl-z Scroll One Line Up
Ctrl-\\ Reconnect to input method
Kanji Reconnect to input method
</pre><p>
</p><p>
In addition, the pointer may be used to cut and paste text:
</p><p>
</p><pre class="literallayout">
Button 1 Down Start Selection
Button 1 Motion Adjust Selection
Button 1 Up End Selection (cut)
Button 2 Down Insert Current Selection (paste)
Button 3 Down Extend Current Selection
Button 3 Motion Adjust Selection
Button 3 Up End Selection (cut)
</pre><p>
</p><p>
Since all of these key and pointer bindings are set through the
translations and resource manager, the user and the application
programmer can modify them by changing the Text widget's
<code class="function">translations</code> resource.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Search_and_Replace"></a>Search and Replace</h3></div></div></div><p>
The Text widget provides a search popup that can be used to search for a
string within the current Text widget. The popup can be activated by
typing either <span class="emphasis"><em>Control-r</em></span> or <span class="emphasis"><em>Control-s</em></span>. If <span class="emphasis"><em>Control-s</em></span> is
used the search will be forward in the file from the current location of the
insertion point; if <span class="emphasis"><em>Control-r</em></span> is used the search will be backward. The
activated popup is placed under the pointer. It has a number of buttons
that allow both text searches and text replacements to be performed.
</p><p>
At the top of the search popup are two toggle buttons labeled
<span class="emphasis"><em>backward</em></span> and <span class="emphasis"><em>forward</em></span>. One of these buttons will always be
highlighted; this is the direction in which the search will be
performed. The user can change the direction at any time by clicking on
the appropriate button.
</p><p>
Directly under the buttons there are two text areas, one labeled
<span class="emphasis"><em>Search for:</em></span> and the other labeled <span class="emphasis"><em>Replace with:</em></span>. If this is
a read-only Text widget the <span class="emphasis"><em>Replace with:</em></span> field will be insensitive
and no replacements will be allowed. After each of these labels will be
a text field. This field will allow the user to enter a string to
search for and the string to replace it with. Only one of these text
fields will have a window border around it; this is the active text
field. Any key presses that occur when the focus in in the search popup
will be directed to the active text field. There are also a few special
key sequences:
</p><pre class="literallayout">
<code class="function">Carriage Return</code>: Execute the action, and pop down the search widget.
<code class="function">Tab</code>: Execute the action, then move to the next field.
<code class="function">Shift Carriage Return</code>: Execute the action, then move to the next field.
<code class="function">Control-q Tab</code>: Enter a Tab into a text field.
<code class="function">Control-c</code>: Pop down the search popup.
</pre><p>
</p><p>
Using these special key sequences should allow simple
searches without ever removing one's hands from the keyboard.
</p><p>
Near the bottom of the search popup is a row of buttons. These buttons
allow the same actions to to be performed as the key sequences, but the
buttons will leave the popup active. This can be quite useful if many
searches are being performed, as the popup will be left on the display.
Since the search popup is a transient window, it may be picked
up with the window manager and pulled off to the side for use
at a later time.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">Search</span></p></td><td><p>
Search for the specified string.
</p></td></tr><tr><td><p><span class="term">Replace</span></p></td><td><p>
Replace the currently highlighted string with the string in the
<span class="emphasis"><em>Replace with</em></span> text field, and move onto the next occurrence of the
<span class="emphasis"><em>Search for</em></span> text field. The functionality is commonly referred to as
query-replace.
</p></td></tr><tr><td><p><span class="term">ReplaceAll</span></p></td><td><p>
Replace all occurrences of the search string with the replace string from
the current insertion point position to the end (or beginning) of the
file. There is no key sequence to perform this action.
</p></td></tr><tr><td><p><span class="term">ReplaceAll</span></p></td><td><p>
Remove the search popup from the screen.
</p></td></tr></tbody></table></div><p>
Finally, when <code class="function">international</code> resource is <code class="function">true</code>, there may be a
pre-edit buffer below the button row, for composing input. Its presence
is determined by the X locale in use and the VendorShell's <code class="function">preeditType</code>
resource.
</p><p>
The widget hierarchy for the search popup is show below, all widgets
are listed by class and instance name.
</p><pre class="literallayout">
Text <name of Text widget>
TransientShell search
Form form
Label label1
Label label2
Toggle backwards
Toggle forwards
Label searchLabel
Text searchText
Label replaceLabel
Text replaceText
Command search
Command replaceOne
Command replaceAll
Command cancel
</pre><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="File_Insertion"></a>File Insertion</h3></div></div></div><p>
To insert a file into a text widget, type the key sequence <span class="emphasis"><em>Meta-i</em></span>,
which will activate the file insert popup. This popup will appear under
the pointer, and any text typed while the focus is in this popup will be
redirected to the text field used for the filename. When the desired
filename has been entered, click on <span class="emphasis"><em>Insert File</em></span>, or type
<span class="emphasis"><em>Carriage Return</em></span>. The named file will then be inserted in the text
widget beginning at the insertion point position. If an error occurs when
opening the file, an error message will be printed, prompting the user
to enter the filename again. The file insert may be aborted by clicking
on <span class="emphasis"><em>Cancel</em></span>. If <span class="emphasis"><em>Meta-i</em></span> is typed at a text widget that is
read-only, it will beep, as no file insertion is allowed.
</p><p>
The widget hierarchy for the file insert popup is show below; all widgets
are listed by class and instance name.
</p><pre class="literallayout">
Text <name of Text widget>
TransientShell insertFile
Form form
Label label
Text text
Command insert
Command cancel
</pre><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Text_Selections_for_Users"></a>Text Selections for Users</h3></div></div></div><p>
The text widgets have a text selection mechanism that allows
the user to copy pieces of the text into the <code class="function">PRIMARY</code> selection,
and paste
into the text widget some text that another application (or text
widget) has put in the <code class="function">PRIMARY</code> selection.
</p><p>
One method of selecting text is to press pointer button 1
on the beginning of the text to be selected, drag the pointer until all
of the desired text is highlighted, and then release the button to
activate the selection. Another method is to click pointer button 1 at
one end of the text to be selected, then click pointer button 3 at the
other end.
</p><p>
To modify a currently active selection, press pointer button 3 near
either the end of the selection that you want to
adjust. This end of the selection may be moved while holding down pointer
button 3. When the proper area has been highlighted release the pointer
button to activate the selection.
</p><p>
The selected text may now be pasted into another application, and
will remain active until some other client makes a selection.
To paste text that some other application has
put into the <code class="function">PRIMARY</code> selection use pointer button 2.
First place the insertion point where you would like the text to be inserted,
then click and release pointer button 2.
</p><p>
Rapidly clicking pointer button 1 the following number of times will adjust
the selection as described.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Two</code>
</span></p></td><td><p>
Select the word under the pointer. A word boundary is defined by the
Text widget to be a Space, Tab, or Carriage Return.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Three</code>
</span></p></td><td><p>
Select the line under the pointer.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Four</code>
</span></p></td><td><p>
Select the paragraph under the pointer. A paragraph boundary is
defined by the text widget as two Carriage Returns in a row with only
Spaces or Tabs between them.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Five</code>
</span></p></td><td><p>
Select the entire text buffer.
</p></td></tr></tbody></table></div><p>
</p><p>
To unset the text selection, click pointer button 1 without moving it.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Text_Widget_Actions"></a>Text Widget Actions</h2></div></div></div><p>
All editing functions are performed by translation manager actions that may
be specified through the <code class="function">translations</code> resource in the Text widget.
</p><p>
</p><pre class="literallayout">
Insert Point Movement Delete
forward-character delete-next-character
backward-character delete-previous-character
forward-word delete-next-word
backward-word delete-previous-word
forward-paragraph delete-selection
backward-paragraph
beginning-of-line
end-of-line Selection
next-line select-word
previous-line select-all
next-page select-start
previous-page select-adjust
beginning-of-file select-end
end-of-file extend-start
scroll-one-line-up extend-adjust
scroll-one-line-down extend-end
insert-selection
Miscellaneous New Line
redraw-display newline-and-indent
insert-file newline-and-backup
insert-char newline
insert-string
display-caret
focus-in Kill
focus-in kill-word
search backward-kill-word
multiply kill-selection
form-paragraph kill-to-end-of-line
transpose-characters kill-paragraph
no-op kill-to-end-of-paragraph
XawWMProtocols
reconnect-im
</pre><p>
</p><p>
Most of the actions take no arguments, and unless otherwise noted you
may assume this to be the case.
</p><p>
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Cursor_Movement_Actions"></a>Cursor Movement Actions\fP</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
forward-character()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
backward-character()
</span></p></td><td><p>
These actions move the insert point forward or backward one character in
the buffer. If the insert point is at the end or beginning of a line
this action will move the insert point to the next (or previous) line.
</p></td></tr><tr><td><p><span class="term">
forward-word()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
backward-word()
</span></p></td><td><p>
These actions move the insert point to the next or previous word boundary.
A word boundary is defined as a Space, Tab or Carriage Return.
</p></td></tr><tr><td><p><span class="term">
forward-paragraph()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
backward-paragraph()
</span></p></td><td><p>
These actions move the insert point to the next or previous paragraph boundary.
A paragraph boundary is defined as two Carriage Returns in a row with only
Spaces or Tabs between them.
</p></td></tr><tr><td><p><span class="term">
beginning-of-line()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
end-of-line()
</span></p></td><td><p>
These actions move to the beginning or end of the current line. If the
insert point is already at the end or beginning of the line then no action is taken.
</p></td></tr><tr><td><p><span class="term">
next-line()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
previous-line()
</span></p></td><td><p>
These actions move the insert point up or down one line. If the insert
point is currently N characters from the beginning of the line then it
will be N characters from the beginning of the next or previous line.
If N is past the end of the line, the insert point is placed at the end
of the line.
</p></td></tr><tr><td><p><span class="term">
next-page()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
previous-page()
</span></p></td><td><p>
These actions move the insert point up or down one page in the file.
One page is defined as the current height of the text widget. The
insert point is always placed at the first character of the top line by
this action.
</p></td></tr><tr><td><p><span class="term">
beginning-of-file()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
end-of-file()
</span></p></td><td><p>
These actions place the insert point at the beginning or end of the
current text buffer. The text widget is then scrolled the minimum
amount necessary to make the new insert point location visible.
</p></td></tr><tr><td><p><span class="term">
scroll-one-line-up()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
scroll-one-line-down()
</span></p></td><td><p>
These actions scroll the current text field up or down by one line.
They do not move the insert point. Other than the scrollbars this is
the only way that the insert point may be moved off of the visible text
area. The widget will be scrolled so that the insert point is back on
the screen as soon as some other action is executed.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Delete_Actions"></a>Delete Actions</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
delete-next-character()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
delete-previous-character()
</span></p></td><td><p>
These actions remove the character immediately before or after the
insert point. If a Carriage Return is removed then the next line is
appended to the end of the current line.
</p></td></tr><tr><td><p><span class="term">
delete-next-word()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
delete-previous-word()
</span></p></td><td><p>
These actions remove all characters between the insert point location and
the next word boundary. A word boundary is defined as a Space, Tab or
Carriage Return.
</p></td></tr><tr><td><p><span class="term">
delete-selection()
</span></p></td><td><p>
This action removes all characters in the current selection.
The selection can be set with the selection actions.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Selection_Actions"></a>Selection Actions</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
select-word()
</span></p></td><td><p>
This action selects the word in which the insert point is currently located.
If the insert point is between words then it will select the previous word.
</p></td></tr><tr><td><p><span class="term">
select-all()
</span></p></td><td><p>
This action selects the entire text buffer.
</p></td></tr><tr><td><p><span class="term">
select-start()
</span></p></td><td><p>
This action sets the insert point to the current pointer location (if
triggered by a button event) or text cursor location (if triggered by
a key event). It
will then begin a selection at this location. If many of these
selection actions occur quickly in succession then the selection count
mechanism will be invoked (see the section titled \fBText Selections for
Application Programmers\fP for details).
</p></td></tr><tr><td><p><span class="term">
select-adjust()
</span></p></td><td><p>
This action allows a selection started with the <span class="emphasis"><em>select-start</em></span>
action to be modified, as described above.
</p></td></tr><tr><td><p><span class="term">
select-end(<span class="emphasis"><em>name</em></span>[,<span class="emphasis"><em>name</em></span>,...])
</span></p></td><td><p>
This action ends a text selection that began with the <span class="emphasis"><em>select-start</em></span>
action, and asserts ownership of the selection or selections specified.
A <span class="emphasis"><em>name</em></span> can be a selection (e.g., <code class="function">PRIMARY</code>) or a cut buffer
(e.g., <code class="function">CUT_BUFFER0</code>). Note that case is important. If no
<span class="emphasis"><em>names</em></span> are specified, <code class="function">PRIMARY</code> is asserted.
</p></td></tr><tr><td><p><span class="term">
extend-start()
</span></p></td><td><p>
This action finds the nearest end of the current selection, and moves it
to the current pointer location (if triggered by a button event) or text
cursor location (if triggered by a key event).
</p></td></tr><tr><td><p><span class="term">
extend-adjust()
</span></p></td><td><p>
This action allows a selection started with an <span class="emphasis"><em>extend-start</em></span> action
to be modified.
</p></td></tr><tr><td><p><span class="term">
extend-end(<span class="emphasis"><em>name</em></span>[,<span class="emphasis"><em>name</em></span>,...])
</span></p></td><td><p>
This action ends a text selection that began with the <span class="emphasis"><em>extend-start</em></span>
action, and asserts ownership of the selection or selections specified.
A <span class="emphasis"><em>name</em></span> can be a selection (e.g. <code class="function">PRIMARY</code>) or a cut buffer
(e.g <code class="function">CUT_BUFFER0</code>). Note that case is important. If no names are
given, <code class="function">PRIMARY</code> is asserted.
</p></td></tr><tr><td><p><span class="term">
insert-selection(<span class="emphasis"><em>name</em></span>[,<span class="emphasis"><em>name</em></span>,...])
</span></p></td><td><p>
This action retrieves the value of the first (left-most) named selection
that exists or the cut buffer that is not empty and inserts it into the
Text widget at the current insert point location. A <span class="emphasis"><em>name</em></span> can be a
selection (e.g. <code class="function">PRIMARY</code>) or a cut buffer (e.g <code class="function">CUT_BUFFER0</code>).
Note that case is important.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="The_New_Line_Actions"></a>The New Line Actions</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
newline-and-indent()
</span></p></td><td><p>
This action inserts a newline into the text and adds spaces to
that line to indent it to match the previous line.
</p></td></tr><tr><td><p><span class="term">
newline-and-backup()
</span></p></td><td><p>
This action inserts a newline into the text <span class="emphasis"><em>after</em></span> the insert point.
</p></td></tr><tr><td><p><span class="term">
newline()
</span></p></td><td><p>
This action inserts a newline into the text <span class="emphasis"><em>before</em></span> the insert point.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Kill_and_Actions"></a>Kill and Actions</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
kill-word()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
backward-kill-word()
</span></p></td><td><p>
These actions act exactly like the <span class="emphasis"><em>delete-next-word</em></span> and
<span class="emphasis"><em>delete-previous-word</em></span> actions, but they stuff the word that was
killed into the kill buffer (<code class="function">CUT_BUFFER_1</code>).
</p></td></tr><tr><td><p><span class="term">
kill-selection()
</span></p></td><td><p>
This action deletes the current selection and stuffs the deleted text into
the kill buffer (<code class="function">CUT_BUFFER_1</code>).
</p></td></tr><tr><td><p><span class="term">
kill-to-end-of-line()
</span></p></td><td><p>
This action deletes the entire line to the right of the insert point position,
and stuffs the deleted text into the kill buffer (<code class="function">CUT_BUFFER_1</code>).
</p></td></tr><tr><td><p><span class="term">
kill-paragraph()
</span></p></td><td><p>
This action deletes the current paragraph, if between paragraphs it deletes
the paragraph above the insert point, and stuffs the deleted text into
the kill buffer (<code class="function">CUT_BUFFER_1</code>).
</p></td></tr><tr><td><p><span class="term">
kill-to-end-of-paragraph()
</span></p></td><td><p>
This action deletes everything between the current insert point location and
the next paragraph boundary, and stuffs the deleted text into the kill
buffer (<code class="function">CUT_BUFFER_1</code>).
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Miscellaneous_Actions"></a>Miscellaneous Actions</h3></div></div></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
redraw-display()
</span></p></td><td><p>
This action recomputes the location of all the text lines on the
display, scrolls the text to vertically center the line containing the insert point
on the screen, clears the entire screen, and redisplays it.
</p></td></tr><tr><td><p><span class="term">
insert-file([<span class="emphasis"><em>filename</em></span>])
</span></p></td><td><p>
This action activates the insert file popup. The <span class="emphasis"><em>filename</em></span>
option specifies the default filename to put in the filename buffer of
the popup. If no <span class="emphasis"><em>filename</em></span> is specified the buffer is empty
at startup.
</p></td></tr><tr><td><p><span class="term">
insert-char()
</span></p></td><td><p>
This action may only be attached to a key event. When the
<code class="function">international</code> resource is <code class="function">false</code>, this action
calls XLookupString to translate the event into a (rebindable) Latin-1
character (sequence) and inserts it into the text at the
insert point. When the <code class="function">international</code> resource is <code class="function">true</code>,
characters are passed to the input method via XwcLookupString, and any
committed string returned is inserted into the text at the insert point.
</p></td></tr><tr><td><p><span class="term">
insert-string(<span class="emphasis"><em>string</em></span>[,<span class="emphasis"><em>string</em></span>,...])
</span></p></td><td><p>
This action inserts each <span class="emphasis"><em>string</em></span> into the text
at the insert point location. Any <span class="emphasis"><em>string</em></span>
beginning with the characters "0x" followed by an even
number of hexadecimal digits is
interpreted as a hexadecimal constant and the
corresponding string is inserted instead. This
hexadecimal string may represent up to 50 8-bit characters.
When the<code class="function">international</code> resource is
<code class="function">true</code>, a hexadecimal string is intrepeted as
being in a multi-byte encoding, and a hexadecimal
or regular string will result in an error message
if it is not legal in the current locale.
</p></td></tr><tr><td><p><span class="term">
display-caret(<span class="emphasis"><em>state</em></span>,<span class="emphasis"><em>when</em></span>)
</span></p></td><td><p>
This action allows the insert point to be turned on and off.
The <span class="emphasis"><em>state</em></span> argument specifies the desired state of the insert point.
This value may be any of the string
values accepted for Boolean resources (e.g. <code class="function">on</code>, <code class="function">True</code>,
<code class="function">off</code>, <code class="function">False</code>, etc.). If no arguments are specified, the
default value is <code class="function">True</code>.
The <span class="emphasis"><em>when</em></span> argument specifies, for <code class="function">EnterNotify</code> or <code class="function">LeaveNotify</code>
events whether or not the focus field in the event is to be examined.
If the second argument is not specified, or specified as something other
than <code class="function">always</code> then if the action is bound to an <code class="function">EnterNotify</code>
or <code class="function">LeaveNotify</code> event, the action will be taken only if the focus
field is <code class="function">True</code>. An augmented binding that might be useful is:
</p></td></tr></tbody></table></div><p>
</p><p>
</p><pre class="literallayout">
*Text.Translations: #override \\
<FocusIn>: display-caret(on) \\n\\
<FocusOut>: display-caret(off)
</pre><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
focus-in()
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
focus-out()
</span></p></td><td><p>
These actions do not currently do anything.
</p></td></tr><tr><td><p><span class="term">
search(<span class="emphasis"><em>direction</em></span>,[<span class="emphasis"><em>string</em></span>])
</span></p></td><td><p>
This action activates the search popup. The <span class="emphasis"><em>direction</em></span> must be
specified as either <code class="function">forward</code> or <code class="function">backward</code>. The string is
optional and is used as an initial value for the <span class="emphasis"><em>Search for</em></span>: string.
For further explanation of the search widget see the section on
<code class="function">Text Searches</code>.
</p></td></tr><tr><td><p><span class="term">
multiply(<span class="emphasis"><em>value</em></span>)
</span></p></td><td><p>
The multiply action allows the user to multiply the effects of many of
the text actions. Thus the following action sequence
<span class="emphasis"><em>multiply(10) delete-next-word()</em></span> will delete 10 words. It does not
matter whether these actions take place in one event or many events.
Using the default translations the key sequence \fIControl-u,
Control-d\fP will delete 4 characters.
Multiply actions can be chained, thus \fImultiply(5)
multiply(5)\fP is the same as <span class="emphasis"><em>multiply(25)</em></span>. If the string
<code class="function">reset</code> is passed to the multiply action the effects of all previous
multiplies are removed and a beep is sent to the display.
</p></td></tr><tr><td><p><span class="term">
form-paragraph()
</span></p></td><td><p>
This action removes all the Carriage Returns from the current
paragraph and reinserts them so that each line is as long as possible, while
still fitting on the current screen. Lines are broken at word boundaries if
at all possible. This action currently works only on Text widgets
that use ASCII text.
</p></td></tr><tr><td><p><span class="term">
transpose-characters()
</span></p></td><td><p>
This action will swap the position of the character to the left of the
insert point with the character to the right of the insert point. The insert point will then
be advanced one character.
</p></td></tr><tr><td><p><span class="term">
no-op([<span class="emphasis"><em>action</em></span>])
</span></p></td><td><p>
The no-op action makes no change to the text widget, and is mainly used
to override translations. This action takes one optional argument. If
this argument is <span class="emphasis"><em>RingBell</em></span> then a beep is sent to the display.
</p></td></tr><tr><td><p><span class="term">
XawWMProtocols([<span class="emphasis"><em>wm_protocol_name</em></span>])
</span></p></td><td><p>
This action is written specifically for the file insertion and the search
and replace
dialog boxes. This action is attached to those shells by the Text widget,
in order to handle ClientMessage events with the WM_PROTOCOLS atom in the
detail field. This action supports WM_DELETE_WINDOW on the Text widget
popups, and may support other window manager protocols if necessary in
the future. The popup will be dismissed if the window manager sends
a WM_DELETE_WINDOW request and there are no parameters in the action
call, which is the default. The popup will also be dismissed if the
parameters include the string ``wm_delete_window,'' and the event is a
ClientMessage event requesting dismissal or is not a ClientMessage event.
This action is not sensitive to the case of the strings passed as parameters.
</p></td></tr><tr><td><p><span class="term">
reconnect-im()
</span></p></td><td><p>
When the <code class="function">international</code> resource is <code class="function">true</code>,
input is usually passed to an input method, a separate
process, for composing. Sometimes the connection to
this process gets severed; this action will attempt to
reconnect it. Causes for severage include network
trouble, and the user explicitly killing one input
method and starting a new one. This action may also
establish first connection when the application is
started before the input method.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Text_Selections_for_Application_Programmers"></a>Text Selections for Application Programmers</h3></div></div></div><p>
The default behavior of the text selection array is described in the
section called <code class="function">Text Selections for Users</code>. To modify the selections
a programmer must construct a <code class="function">XawTextSelectType</code> array (called the
selection array), containing the selections desired, and pass this as
the new value for the <code class="function">selectionTypes</code> resource. The selection
array may also be modified using the <a class="xref" href="#XawTextSetSelectionArray"><code class="function"> XawTextSetSelectionArray</code></a>
function. All selection arrays must end with the value
<code class="function">XawselectNull</code>. The <code class="function">selectionTypes</code> resource has no converter
registered and cannot be modified through the resource manager.
</p><p>
The array contains a list of entries that will be called when the user
attempts to select text in rapid succession with the <span class="emphasis"><em>select-start</em></span>
action (usually by clicking a pointer button). The first entry in the
selection array will be used when the <span class="emphasis"><em>select-start</em></span> action is
initially called. The next entry will be used when <span class="emphasis"><em>select-start</em></span>
is called again, and so on. If a timeout value (1/10 of a second) is
exceeded, the the next <span class="emphasis"><em>select-start</em></span> action will begin at the top
of the selection array. When <code class="function">XawselectNull</code> is reached the array
is recycled beginning with the first element.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /></colgroup><tbody><tr><td align="center"><code class="function">XawselectAll</code></td><td align="center">Selects the contents of the entire buffer.</td></tr><tr><td align="center"><code class="function">XawselectChar</code></td><td align="center">Selects text characters as the pointer moves over them.</td></tr><tr><td align="center"><code class="function">XawselectLine</code></td><td align="center">Selects the entire line.</td></tr><tr><td align="center"><code class="function">XawselectNull</code></td><td align="center">Indicates the end of the selection array.</td></tr><tr><td align="center"><code class="function">XawselectParagraph</code></td><td align="center">Selects the entire paragraph.</td></tr><tr><td align="center"><code class="function">XawselectPosition</code></td><td align="center">Selects the current pointer position.</td></tr><tr><td align="center"><code class="function">XawselectWord</code></td><td align="center">Selects whole words as the pointer moves onto them.</td></tr></tbody></table></div><p>
</p><p>
The default selectType array is:
</p><p>
</p><pre class="literallayout">
{XawselectPosition, XawselectWord, XawselectLine, XawselectParagraph, XawselectAll, XawselectNull}
</pre><p>
</p><p>
The selection array is not copied by the text widgets. The
application must allocate space for the array and cannot deallocate or
change it until the text widget is destroyed or until a new selection
array is set.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Default_Translation_Bindings"></a>Default Translation Bindings</h2></div></div></div><p>
The following translations are defaults built into every Text widget.
They can be overridden, or replaced by specifying a new value for the
Text widget's <code class="function">translations</code> resource.
</p><p>
</p><pre class="literallayout">
Ctrl<Key>A: beginning-of-line() \\n\\
Ctrl<Key>B: backward-character() \\n\\
Ctrl<Key>D: delete-next-character() \\n\\
Ctrl<Key>E: end-of-line() \\n\\
Ctrl<Key>F: forward-character() \\n\\
Ctrl<Key>G: multiply(Reset) \\n\\
Ctrl<Key>H: delete-previous-character() \\n\\
Ctrl<Key>J: newline-and-indent() \\n\\
Ctrl<Key>K: kill-to-end-of-line() \\n\\
Ctrl<Key>L: redraw-display() \\n\\
Ctrl<Key>M: newline() \\n\\
Ctrl<Key>N: next-line() \\n\\
Ctrl<Key>O: newline-and-backup() \\n\\
Ctrl<Key>P: previous-line() \\n\\
Ctrl<Key>R: search(backward) \\n\\
Ctrl<Key>S: search(forward) \\n\\
Ctrl<Key>T: transpose-characters() \\n\\
Ctrl<Key>U: multiply(4) \\n\\
Ctrl<Key>V: next-page() \\n\\
Ctrl<Key>W: kill-selection() \\n\\
Ctrl<Key>Y: insert-selection(CUT_BUFFER1) \\n\\
Ctrl<Key>Z: scroll-one-line-up() \\n\\
Ctrl<Key>\\: reconnect-im() \\n\\
Meta<Key>B: backward-word() \\n\\
Meta<Key>F: forward-word() \\n\\
Meta<Key>I: insert-file() \\n\\
Meta<Key>K: kill-to-end-of-paragraph() \\n\\
Meta<Key>Q: form-paragraph() \\n\\
Meta<Key>V: previous-page() \\n\\
Meta<Key>Y: insert-selection(PRIMARY, CUT_BUFFER0) \\n\\
Meta<Key>Z: scroll-one-line-down() \\n\\
:Meta<Key>d: delete-next-word() \\n\\
:Meta<Key>D: kill-word() \\n\\
:Meta<Key>h: delete-previous-word() \\n\\
:Meta<Key>H: backward-kill-word() \\n\\
:Meta<Key>\\<: beginning-of-file() \\n\\
:Meta<Key>\\>: end-of-file() \\n\\
:Meta<Key>]: forward-paragraph() \\n\\
:Meta<Key>[: backward-paragraph() \\n\\
~Shift Meta<Key>Delete: delete-previous-word() \\n\\
\ Shift Meta<Key>Delete: backward-kill-word() \\n\\
~Shift Meta<Key>Backspace: delete-previous-word() \\n\\
\ Shift Meta<Key>Backspace: backward-kill-word() \\n\\
<Key>Right: forward-character() \\n\\
<Key>Left: backward-character() \\n\\
<Key>Down: next-line() \\n\\
<Key>Up: previous-line() \\n\\
<Key>Delete: delete-previous-character() \\n\\
<Key>BackSpace: delete-previous-character() \\n\\
<Key>Linefeed: newline-and-indent() \\n\\
<Key>Return: newline() \\n\\
<Key>: insert-char() \\n\\
<Key>Kanji: reconnect-im() \\n\\
<FocusIn>: focus-in() \\n\\
<FocusOut>: focus-out() \\n\\
<Btn1Down>: select-start() \\n\\
<Btn1Motion>: extend-adjust() \\n\\
<Btn1Up>: extend-end(PRIMARY, CUT_BUFFER0) \\n\\
<Btn2Down>: insert-selection(PRIMARY, CUT_BUFFER0) \\n\\
<Btn3Down>: extend-start() \\n\\
<Btn3Motion>: extend-adjust() \\n\\
<Btn3Up>: extend-end(PRIMARY, CUT_BUFFER0) \\n
</pre><p>
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Text_Functions"></a>Text Functions</h2></div></div></div><p>
The following functions are provided as convenience routines for use with
the Text widget. Although many of these actions can be performed by
modifying resources, these interfaces are frequently more efficient.
</p><p>
These data structures are defined in the Text widget's public header file,
<X11/Xaw/Text.h>.
</p><p>
typedef long XawTextPosition;
</p><p>
Character positions in the Text widget begin at 0 and end at n, where
n is the number of characters in the Text source widget.
</p><p>
</p><pre class="literallayout">
typedef struct {
int <span class="emphasis"><em>firstPos</em></span>;
int <span class="emphasis"><em>length</em></span>;
char *<span class="emphasis"><em>ptr</em></span>;
unsigned long <span class="emphasis"><em>format</em></span>;
} XawTextBlock, *XawTextBlockPtr;
</pre><p>
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>firstPos</em></span>
</span></p></td><td><p>
The first position, or index, to use within the <span class="emphasis"><em>ptr</em></span> field.
The value is commonly zero.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>length</em></span>
</span></p></td><td><p>
The number of characters to be used from the <span class="emphasis"><em>ptr</em></span> field.
The number of characters used is commonly the number of characters
in <span class="emphasis"><em>ptr</em></span>, and must not be greater than the length of the string
in <span class="emphasis"><em>ptr</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>ptr</em></span>
</span></p></td><td><p>
Contains the string to be referenced by the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>format</em></span>
</span></p></td><td><p>
This flag indicates whether the data pointed to by <code class="function">ptr</code> is char
or wchar_t. When the associated widget has <code class="function">international</code> set
to <code class="function">false</code> this field must be XawFmt8Bit. When the associated
widget has <code class="function">international</code> set to <code class="function">true</code> this field must be
either XawFmt8Bit or XawFmtWide.
</p></td></tr></tbody></table></div><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Note: Previous versions of Xaw used
<code class="function">FMT8BIT ,</code>
which has been retained for backwards compatibility. <code class="function">FMT8BIT</code> is
deprecated and will eventually be removed from the implementation.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Selecting_Text"></a>Selecting Text</h3></div></div></div><p>
To select a piece of text, use
<code class="function">XawTextSetSelection : </code>
</p><div class="funcsynopsis"><a id="XawTextSetSelection"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextSetSelection</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionleft,<var class="pdparam"> right</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>left</em></span>
</span></p></td><td><p>
Specifies the character position at which the selection begins.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>right</em></span>
</span></p></td><td><p>
Specifies the character position at which the selection ends.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
If redisplay is enabled, this function highlights the text and
makes it the <code class="function">PRIMARY</code> selection. This function does not have any
effect on <code class="function">CUT_BUFFER0</code>.
</p><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Unhighlighting_Text"></a>Unhighlighting Text</h3></div></div></div><p>
To unhighlight previously highlighted text in a widget, use
<a class="xref" href="#XawTextUnsetSelection"><code class="function"> XawTextUnsetSelection</code></a>:
</p><div class="funcsynopsis"><a id="XawTextUnsetSelection"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextUnsetSelection</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Getting_Current_Text_Selection"></a>Getting Current Text Selection</h3></div></div></div><p>
To retrieve the text that has been selected by this
text widget use <a class="xref" href="#XawTextGetSelectionPos"><code class="function"> XawTextGetSelectionPos</code></a>:
</p><div class="funcsynopsis"><a id="XawTextGetSelectionPos"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextGetSelectionPos</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition*begin_return,<var class="pdparam"> *end_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>begin_return</em></span>
</span></p></td><td><p>
Returns the beginning of the text selection.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>end_return</em></span>
</span></p></td><td><p>
Returns the end of the text selection.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
If the returned values are equal, no text is currently selected.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Replacing_Text"></a>Replacing Text</h3></div></div></div><p>
To modify the text in an editable Text widget use <a class="xref" href="#XawTextReplace"><code class="function"> XawTextReplace</code></a>:
</p><div class="funcsynopsis"><a id="XawTextReplace"></a><p><code class="funcdef">int<strong class="fsfunc"> XawTextReplace</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionstart,<var class="pdparam"> end</var>, XawTextBlock<var class="pdparam"> *text</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>start</em></span>
</span></p></td><td><p>
Specifies the starting character position of the text replacement.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>end</em></span>
</span></p></td><td><p>
Specifies the ending character position of the text replacement.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>text</em></span>
</span></p></td><td><p>
Specifies the text to be inserted into the file.
</p></td></tr></tbody></table></div><p>
</p><p>
This function will not
be able to replace text in read-only text widgets. It will also only
be able to append text to an append-only text widget.
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code> and
<code class="function">XawTextBlock</code>.
</p><p>
This function may return the following values:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">XawEditDone</code>
</span></p></td><td><p>
The text replacement was successful.
</p></td></tr><tr><td><p><span class="term">
<code class="function">XawPositionError</code>
</span></p></td><td><p>
The edit mode is <code class="function">XawtextAppend</code> and <code class="function">start</code> is not the position of
the last character of the source.
</p></td></tr><tr><td><p><span class="term">
<code class="function">XawEditError</code>
</span></p></td><td><p>
Either the Source was read-only or the range to be deleted is larger
than the length of the Source.
</p></td></tr></tbody></table></div><p>
</p><p>
The <a class="xref" href="#XawTextReplace"><code class="function"> XawTextReplace</code></a> arguments <code class="function">start</code> and
<span class="emphasis"><em>end</em></span> represent the text source character positions for the
existing text that is to be replaced by the text in the text block.
The characters from <span class="emphasis"><em>start</em></span> up to
but not including <span class="emphasis"><em>end</em></span> are deleted, and the characters
specified on the text block are inserted in their place. If
<span class="emphasis"><em>start</em></span> and <span class="emphasis"><em>end</em></span> are equal, no text is deleted and the new
text is inserted after <span class="emphasis"><em>start</em></span>.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Searching_for_Text"></a>Searching for Text</h3></div></div></div><p>
To search for a string in the Text widget, use
<a class="xref" href="#XawTextSearch"><code class="function"> XawTextSearch</code></a>:
</p><div class="funcsynopsis"><a id="XawTextSearch"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> XawTextSearch</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextScanDirection<var class="pdparam"> dir</var>, XawTextBlock*<var class="pdparam"> text</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>dir</em></span>
</span></p></td><td><p>
Specifies the direction to search in. Legal values are
<code class="function">XawsdLeft</code> and <code class="function">XawsdRight</code>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>text</em></span>
</span></p></td><td><p>
Specifies a text block structure that contains the text to search for.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code> and <code class="function">XawTextBlock</code>.
The <a class="xref" href="#XawTextSearch"><code class="function"> XawTextSearch</code></a> function will begin at the insertion point
and search in the
direction specified for a string that matches the one passed in
<span class="emphasis"><em>text</em></span>. If the string is found the location of the first
character in the string is returned. If the string could not be
found then the value <code class="function">XawTextSearchError</code> is returned.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Redisplaying_Text"></a>Redisplaying Text</h3></div></div></div><p>
To redisplay a range of characters, use <a class="xref" href="#XawTextInvalidate"><code class="function"> XawTextInvalidate</code></a>:
</p><div class="funcsynopsis"><a id="XawTextInvalidate"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextInvalidate</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionfrom,<var class="pdparam"> to</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>from</em></span>
</span></p></td><td><p>
Specifies the start of the text to redisplay.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>to</em></span>
</span></p></td><td><p>
Specifies the end of the text to redisplay.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
The <a class="xref" href="#XawTextInvalidate"><code class="function"> XawTextInvalidate</code></a>
function causes the specified range of characters to be redisplayed
immediately if redisplay is enabled or the next time that redisplay is
enabled.
</p><p>
To enable redisplay, use <a class="xref" href="#XawTextEnableRedisplay"><code class="function"> XawTextEnableRedisplay</code></a>:
</p><div class="funcsynopsis"><a id="XawTextEnableRedisplay"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextEnableRedisplay</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
The <a class="xref" href="#XawTextEnableRedisplay"><code class="function"> XawTextEnableRedisplay</code></a> function flushes any changes due to
batched updates when <a class="xref" href="#XawTextDisableRedisplay"><code class="function"> XawTextDisableRedisplay</code></a>
was called and allows future changes to be reflected immediately.
</p><p>
To disable redisplay while making several changes, use
<a class="xref" href="#XawTextDisableRedisplay"><code class="function"> XawTextDisableRedisplay</code></a>.
</p><div class="funcsynopsis"><a id="XawTextDisableRedisplay"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextDisableRedisplay</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
The <a class="xref" href="#XawTextDisableRedisplay"><code class="function"> XawTextDisableRedisplay</code></a> function causes all changes to be
batched until either <a class="xref" href="#XawTextDisplay"><code class="function"> XawTextDisplay</code></a> or <a class="xref" href="#XawTextEnableRedisplay"><code class="function"> XawTextEnableRedisplay</code></a>
is called.
</p><p>
To display batched updates, use <a class="xref" href="#XawTextDisplay"><code class="function"> XawTextDisplay</code></a>:
</p><div class="funcsynopsis"><a id="XawTextDisplay"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextDisplay</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
The <a class="xref" href="#XawTextDisplay"><code class="function"> XawTextDisplay</code></a> function forces any accumulated updates to be
displayed.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Resources_Convenience_Routines"></a>Resources Convenience Routines</h3></div></div></div><p>
To obtain the character position of the left-most character on the
first line displayed in the widget (the value of the
<code class="function">displayPosition</code> resource), use <a class="xref" href="#XawTextTopPosition"><code class="function"> XawTextTopPosition</code></a>.
</p><div class="funcsynopsis"><a id="XawTextTopPosition"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> XawTextTopPosition</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
To assign a new selection array to a text widget use
<a class="xref" href="#XawTextSetSelectionArray"><code class="function"> XawTextSetSelectionArray</code></a>:
</p><div class="funcsynopsis"><a id="XawTextSetSelectionArray"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextSetSelectionArray</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextSelectType*<var class="pdparam"> sarray</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>sarray</em></span>
</span></p></td><td><p>
Specifies a selection array as defined in the section called \fBText
Selections for Application Programmers\fP.
</p></td></tr></tbody></table></div><p>
</p><p>
Calling this function is equivalent to setting the value of the
<code class="function">selectionTypes</code> resource.
</p><p>
To move the insertion point to the specified source position, use
<a class="xref" href="#XawTextSetInsertionPoint"><code class="function"> XawTextSetInsertionPoint</code></a>:
</p><div class="funcsynopsis"><a id="XawTextSetInsertionPoint"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextSetInsertionPoint</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> position</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>position</em></span>
</span></p></td><td><p>
Specifies the new position for the insertion point.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
The text will be scrolled vertically if necessary to make the line
containing the insertion point visible. Calling this function is
equivalent to setting the <code class="function">insertPosition</code> resource.
</p><p>
To obtain the current position of the insertion point, use
<a class="xref" href="#XawTextGetInsertionPoint"><code class="function"> XawTextGetInsertionPoint</code></a>:
</p><div class="funcsynopsis"><a id="XawTextGetInsertionPoint"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> XawTextGetInsertionPoint</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
The result is equivalent to retrieving the value of the
<code class="function">insertPosition</code> resource.
</p><p>
To replace the text source in the specified widget, use
<a class="xref" href="#XawTextSetSource"><code class="function"> XawTextSetSource</code></a>:
</p><div class="funcsynopsis"><a id="XawTextSetSource"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextSetSource</strong>(</code>Widget<var class="pdparam"> w</var>, Widget<var class="pdparam"> source</var>, XawTextPosition<var class="pdparam"> position</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>source</em></span>
</span></p></td><td><p>
Specifies the text source object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>position</em></span>
</span></p></td><td><p>
Specifies character position that will become the upper left hand corner
of the displayed text. This is usually set to zero.
</p></td></tr></tbody></table></div><p>
</p><p>
See section 5.4 for a description of <code class="function">XawTextPosition</code>.
A display update will be performed if redisplay is enabled.
</p><p>
To obtain the current text source for the specified widget, use
<a class="xref" href="#XawTextGetSource"><code class="function"> XawTextGetSource</code></a>:
</p><div class="funcsynopsis"><a id="XawTextGetSource"></a><p><code class="funcdef">Widget<strong class="fsfunc"> XawTextGetSource</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr></tbody></table></div><p>
</p><p>
This function returns the text source that this Text widget is currently
using.
</p><p>
To enable and disable the insertion point, use
<a class="xref" href="#XawTextDisplayCaret"><code class="function"> XawTextDisplayCaret</code></a>:
</p><div class="funcsynopsis"><a id="XawTextDisplayCaret"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTextDisplayCaret</strong>(</code>Widget<var class="pdparam"> w</var>, Boolean<var class="pdparam"> visible</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Text widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>visible</em></span>
</span></p></td><td><p>
Specifies whether or not the caret should be displayed.
</p></td></tr></tbody></table></div><p>
</p><p>
If <code class="function">visible</code> is <code class="function">False</code> the insertion point will be disabled.
The marker is re-enabled either by setting <code class="function">visible</code> to <code class="function">True</code>, by
calling <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>, or by executing the <code class="function">display-caret</code>
action routine.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Customizing_the_Text_Widget"></a>Customizing the Text Widget</h2></div></div></div><p>
</p><p>
The remainder of this chapter will describe customizing the Text
widget. The Text widget may be customized by subclassing, or by
creating new sources and sinks. Subclassing is described in
detail in Chapter 7; this section will describe only those things that
are specific to the Text widget. Attributes of the Text widget base
class and creating new sources and sinks will be discussed.
</p><p>
The Text widget is made up of a number of different pieces, with the
Text widget as the base widget class. It and the AsciiText widget are
the only true "widgets" in the Text widget family. The other pieces
(sources and sinks) are X Toolkit objects and have no window
associated with them. No source or sink is useful unless assigned to
a Text widget.
</p><p>
Each of the following pieces of the Text widget has a specific purpose,
and will be, or has been, discussed in detail in this chapter:
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><code class="function">Text</code></span></p></td><td><p>
This is the glue that binds everything else together. This widget reads
the text data from the source, and displays the information in the sink.
All translations and actions are handled in the Text widget itself.
</p></td></tr><tr><td><p><span class="term"><code class="function">TextSink</code></span></p></td><td><p>
This object is responsible for displaying and clearing the drawing area.
It also reports the configuration of the window that contains the
drawing area. The TextSink does not have its own window; instead it does
its drawing on the Text widget's window.
</p></td></tr><tr><td><p><span class="term"><code class="function">TextSrc</code></span></p></td><td><p>
This object is responsible for reading, editing and searching through the
text buffer.
</p></td></tr><tr><td><p><span class="term"><code class="function">AsciiSink</code></span></p></td><td><p>
This object is a subclass of the TextSink and knows how to display
ASCII text. Support has been added to display any 8-bit character set, given
the font.
</p></td></tr><tr><td><p><span class="term"><code class="function">MultiSink</code></span></p></td><td><p>
This object is a subclass of the TextSink and knows how to display
font sets.
</p></td></tr><tr><td><p><span class="term"><code class="function">AsciiSrc</code></span></p></td><td><p>
This object is a subclass of the TextSrc and knows how to read strings
and files.
</p></td></tr><tr><td><p><span class="term"><code class="function">MultiSrc</code></span></p></td><td><p>
This object is a subclass of the TextSrc and knows how to read strings
and multibyte files, converting them to wide characters based on locale.
</p></td></tr><tr><td><p><span class="term"><code class="function">AsciiText</code></span></p></td><td><p>
This widget is a subclass of the Text widget. When created, the AsciiText
automatically creates and attaches either an AsciiSrc and AsciiSink, or a
MultiSrc and MultiSink, to itself. The AsciiText provides the simplest
interface to the Athena Text widgets.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Text_Widget"></a>Text Widget</h2></div></div></div><pre class="literallayout">
Application Header file <X11/Xaw/Text.h>
Class Header file <X11/Xaw/TextP.h>
Class textWidgetClass
Class Name Text
Superclass Simple
</pre><p>
The Text widget is the glue that binds all the other pieces together, it
maintains the internal state of the displayed text, and acts as a
mediator between the source and sink.
</p><p>
This section lists the resources that are actually part of the
Text widget, and explains the functionality provided by each.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Text::Resources"></a>Resources</h3></div></div></div><p>
When creating a Text widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">autoFill</td><td align="center">AutoFill</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">bottomMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_xterm</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">displayCaret</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">displayPosition</td><td align="center">TextPosition</td><td align="center">XawTextPosition</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Font height + margins</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">insertPosition</td><td align="center">TextPosition</td><td align="center">int</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">leftMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">XawTextResizeMode</td><td align="center"> </td><td align="center">XawtextResizeNever</td></tr><tr><td align="center">rightMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Pointer</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">scrollHorizontal</td><td align="center">Scroll</td><td align="center">ScrollMode</td><td align="center"> </td><td align="center">XawtextScrollNever</td></tr><tr><td align="center">scrollVertical</td><td align="center">Scroll</td><td align="center">XawTextScrollMode</td><td align="center"> </td><td align="center">XawtextScrollNever</td></tr><tr><td align="center">selectTypes</td><td align="center">SelectTypes</td><td align="center">XawTextSelectType*</td><td align="center"> </td><td align="center">See above</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">textSink</td><td align="center">TextSink</td><td align="center">Widget</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">textSource</td><td align="center">TextSource</td><td align="center">Widget</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">topMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See above</td></tr><tr><td align="center">unrealizeCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">100</td></tr><tr><td align="center">wrap</td><td align="center">Wrap</td><td align="center">WrapMode</td><td align="center"> </td><td align="center">XawtextWrapNever</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="TextSink_Object"></a>TextSink Object</h2></div></div></div><p>
</p><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/TextSink.h>
Class Header file <X11/Xaw/TextSinkP.h>
Class textSinkObjectClass
Class Name TextSink
Superclass Object
</pre><p>
</p><p>
The TextSink object is the root object for all text sinks. Any new text
sink objects should be subclasses of the TextSink Object. The TextSink
Class contains all methods that the Text widget expects a text sink to
export.
</p><p>
Since all text sinks will have some resources in common, the TextSink
defines a few new resources.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="TextSink::Resources"></a>Resources</h3></div></div></div><p>
When creating an TextSink object instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Subclassing_the_TextSink"></a>Subclassing the TextSink</h3></div></div></div><p>
The only purpose of the TextSink Object is to be subclassed. It
contains the minimum set of class methods that all text sinks must have.
While all may be inherited, the direct descendant of TextSink <code class="function">must
specify</code> some of them as TextSink does contain enough information to
be a valid text sink by itself. Do not try to use
the TextSink as a valid sink for the Text widget; it is not intended
to be used as a sink by itself.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /></colgroup><thead><tr><th align="center">Function</th><th align="center">Inherit with</th><th align="center">Public Interface</th><th align="center">must specify</th></tr></thead><tbody><tr><td align="center">DisplayText</td><td align="center">XtInheritDisplayText</td><td align="center">XawTextSinkDisplayText</td><td align="center">yes</td></tr><tr><td align="center">InsertCursor</td><td align="center">XtInheritInsertCursor</td><td align="center">XawTextSinkInsertCursor</td><td align="center">yes</td></tr><tr><td align="center">ClearToBackground</td><td align="center">XtInheritClearToBackground</td><td align="center">XawTextSinkClearToBackground</td><td align="center">no</td></tr><tr><td align="center">FindPosition</td><td align="center">XtInheritFindPosition</td><td align="center">XawTextSinkFindPosition</td><td align="center">yes</td></tr><tr><td align="center">FindDistance</td><td align="center">XtInheritFindDistance</td><td align="center">XawTextSinkFindDistance</td><td align="center">yes</td></tr><tr><td align="center">Resolve</td><td align="center">XtInheritResolve</td><td align="center">XawTextSinkResolve</td><td align="center">yes</td></tr><tr><td align="center">MaxLines</td><td align="center">XtInheritMaxLines</td><td align="center">XawTextSinkMaxLines</td><td align="center">no</td></tr><tr><td align="center">MaxHeight</td><td align="center">XtInheritMaxHeight</td><td align="center">XawTextSinkMaxHeight</td><td align="center">no</td></tr><tr><td align="center">SetTabs</td><td align="center">XtInheritSetTabs</td><td align="center">XawTextSinkSetTabs</td><td align="center">no</td></tr><tr><td align="center">GetCursorBounds</td><td align="center">XtInheritGetCursorBounds</td><td align="center">XawTextSinkGetCursorBounds</td><td align="center">yes</td></tr></tbody></table></div><p>
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Displaying_Text"></a>Displaying Text</h4></div></div></div><p>
To display a section of the text buffer contained in the text source
use the function <a class="xref" href="#DisplayText"><code class="function"> DisplayText</code></a>:
</p><div class="funcsynopsis"><a id="DisplayText"></a><p><code class="funcdef">void<strong class="fsfunc"> DisplayText</strong>(</code>Widget<var class="pdparam"> w</var>, Positionx,<var class="pdparam"> y</var>, XawTextPositionpos1,<var class="pdparam"> pos2</var>, Boolean<var class="pdparam"> highlight</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>x</em></span>
</span></p></td><td><p>
Specifies the x location to start drawing the text.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>y</em></span>
</span></p></td><td><p>
Specifies the y location to start drawing text.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>pos1</em></span>
</span></p></td><td><p>
Specifies the location within the text source of the first character
to be printed.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>pos2</em></span>
</span></p></td><td><p>
Specifies the location within the text source of the last character
to be printed.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>highlight</em></span>
</span></p></td><td><p>
Specifies whether or not to paint the text region highlighted.
</p></td></tr></tbody></table></div><p>
</p><p>
The Text widget will only pass one line at a time to the text sink, so
this function does not need to know how to line feed the text. It is
acceptable for this function to just ignore Carriage Returns. <span class="emphasis"><em>x</em></span>
and <span class="emphasis"><em>y</em></span> denote the upper left hand corner of the first character to
be displayed.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Displaying_the_Insert_Point"></a>Displaying the Insert Point</h4></div></div></div><p>
The function that controls the display of the text cursor is
<a class="xref" href="#InsertCursor"><code class="function"> InsertCursor</code></a>. This function will be called whenever the text
widget desires to change the state of, or move the insert point.
</p><div class="funcsynopsis"><a id="InsertCursor"></a><p><code class="funcdef">void<strong class="fsfunc"> InsertCursor</strong>(</code>Widget<var class="pdparam"> w</var>, Positionx,<var class="pdparam"> y</var>, XawTextInsertState<var class="pdparam"> state</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>x</em></span>
</span></p></td><td><p>
Specifies the x location of the cursor in Pixels.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>y</em></span>
</span></p></td><td><p>
Specifies the y location of the cursor in Pixels.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>state</em></span>
</span></p></td><td><p>
Specifies the state of the cursor, may be one of <code class="function">XawisOn</code> or
<code class="function">XawisOff</code>.
</p></td></tr></tbody></table></div><p>
</p><p>
<span class="emphasis"><em>X</em></span> and <span class="emphasis"><em>y</em></span> denote the upper left hand corner of the insert point.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Clearing_Portions_of_the_Text_window"></a>Clearing Portions of the Text window</h4></div></div></div><p>
To clear a portion of the Text window to its background color, the Text
widget will call <a class="xref" href="#ClearToBackground"><code class="function"> ClearToBackground</code></a>. The TextSink object already
defines this function as calling
<span class="olink"><code class="function">XClearArea</code></span>
on the region passed.
This behavior will be used if you specify
<code class="function">XtInheritClearToBackground</code> for this method.
</p><div class="funcsynopsis"><a id="ClearToBackground"></a><p><code class="funcdef">void<strong class="fsfunc"> ClearToBackground</strong>(</code>Widget<var class="pdparam"> w</var>, Positionx,<var class="pdparam"> y</var>, Dimensionwidth,<var class="pdparam"> height</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>x</em></span>
</span></p></td><td><p>
Specifies the x location, in pixels, of the Region to clear.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>y</em></span>
</span></p></td><td><p>
Specifies the y location, in pixels, of the Region to clear.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>width</em></span>
</span></p></td><td><p>
Specifies the width, in pixels, of the Region to clear.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>height</em></span>
</span></p></td><td><p>
Specifies the height, in pixels, of the Region to clear.
</p></td></tr></tbody></table></div><p>
</p><p>
<span class="emphasis"><em>X</em></span> and <span class="emphasis"><em>y</em></span> denote the upper left hand corner of region to clear.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Finding_a_Text_Position_Given_Pixel_Values"></a>Finding a Text Position Given Pixel Values</h4></div></div></div><p>
To find the text character position that will be rendered at a given x
location the Text widget uses the function <a class="xref" href="#FindPosition"><code class="function"> FindPosition</code></a>:
</p><div class="funcsynopsis"><a id="FindPosition"></a><p><code class="funcdef">void<strong class="fsfunc"> FindPosition</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> fromPos</var>, intfromX,<var class="pdparam"> width</var>, Boolean<var class="pdparam"> stopAtWordBreak</var>, XawTextPosition<var class="pdparam"> *pos_return</var>, int*width_return,<var class="pdparam"> *height_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromPos</em></span>
</span></p></td><td><p>
Specifies a reference position, usually the first character in this line.
This character is always to the left of the desired character location.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromX</em></span>
</span></p></td><td><p>
Specifies the distance that the left edge of <span class="emphasis"><em>fromPos</em></span> is from the
left edge of the window. This is the reference x location for the
reference position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>width</em></span>
</span></p></td><td><p>
Specifies the distance, in pixels, from the reference position to the
desired character position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>stopAtWordBreak</em></span>
</span></p></td><td><p>
Specifies whether or not the position that is returned should be forced
to be on a word boundary.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>pos_return</em></span>
</span></p></td><td><p>
Returns the character position that corresponds to the location that has
been specified, or the work break immediately to the left of the
position if <span class="emphasis"><em>stopAtWordBreak</em></span> is <code class="function">True</code>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>width_return</em></span>
</span></p></td><td><p>
Returns the actual distance between <span class="emphasis"><em>fromPos</em></span> and <span class="emphasis"><em>pos_return</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>height_return</em></span>
</span></p></td><td><p>
Returns the maximum height of the text between <span class="emphasis"><em>fromPos</em></span> and
<span class="emphasis"><em>pos_return</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function need make no attempt to deal with line feeds. The text
widget will only call it one line at a time.
</p><p>
Another means of finding a text position is provided by the <a class="xref" href="#Resolve"><code class="function"> Resolve</code></a>
function:
</p><div class="funcsynopsis"><a id="Resolve"></a><p><code class="funcdef">void<strong class="fsfunc"> Resolve</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> fromPos</var>, intfromX,<var class="pdparam"> width</var>, XawTextPosition<var class="pdparam"> *pos_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromPos</em></span>
</span></p></td><td><p>
Specifies a reference position, usually the first character in this line.
This character is always to the left of the desired character location.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromX</em></span>
</span></p></td><td><p>
Specifies the distance that the left edge of <span class="emphasis"><em>fromPos</em></span> is from the
left edge of the window. This is the reference x location for the
reference position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>width</em></span>
</span></p></td><td><p>
Specifies the distance, in pixels, from the reference position to the
desired character position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>pos_return</em></span>
</span></p></td><td><p>
Returns the character position that corresponds to the
location that has been specified, or the word break immediately to the left
if <span class="emphasis"><em>stopAtWordBreak</em></span> is <code class="function">True</code>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function need make no attempt to deal with line feeds. The text
widget will only call it one line at a time. This is a more convenient
interface to the <a class="xref" href="#FindPosition"><code class="function"> FindPosition</code></a> function, and provides a subset of its
functionality.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Finding_the_Distance_Between_two_Text_Positions"></a>Finding the Distance Between two Text Positions</h4></div></div></div><p>
To find the distance in pixels between two text positions on the same
line use the function <a class="xref" href="#FindDistance"><code class="function"> FindDistance</code></a>.
</p><div class="funcsynopsis"><a id="FindDistance"></a><p><code class="funcdef">void<strong class="fsfunc"> FindDistance</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionfromPos,<var class="pdparam"> toPos</var>, int<var class="pdparam"> fromX</var>, XawTextPosition<var class="pdparam"> *pos_return</var>, int*width_return,<var class="pdparam"> *height_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromPos</em></span>
</span></p></td><td><p>
Specifies the text buffer position, in characters, of the first position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>fromX</em></span>
</span></p></td><td><p>
Specifies the distance that the left edge of <span class="emphasis"><em>fromPos</em></span> is from the
left edge of the window. This is the reference x location for the
reference position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>toPos</em></span>
</span></p></td><td><p>
Specifies the text buffer position, in characters, of the second position.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>resWidth</em></span>
</span></p></td><td><p>
Return the actual distance between <span class="emphasis"><em>fromPos</em></span>
and <span class="emphasis"><em>pos_return</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>resPos</em></span>
</span></p></td><td><p>
Returns the character position that corresponds to the actual character
position used for <span class="emphasis"><em>toPos</em></span> in the calculations. This may be
different than <span class="emphasis"><em>toPos</em></span>, for example if <span class="emphasis"><em>fromPos</em></span> and <span class="emphasis"><em>toPos</em></span>
are on different lines in the file.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>height_return</em></span>
</span></p></td><td><p>
Returns the maximum height of the text between <span class="emphasis"><em>fromPos</em></span> and
<span class="emphasis"><em>pos_return</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function need make no attempt to deal with line feeds. The Text
widget will only call it one line at a time.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Finding_the_Size_of_the_Drawing_area"></a>Finding the Size of the Drawing area</h4></div></div></div><p>
To find the maximum number of lines that will fit into the current Text
widget, use the function <a class="xref" href="#MaxLines"><code class="function"> MaxLines</code></a>. The TextSink already defines
this function to compute the maximum number of lines by using the height
of <code class="function">font</code>.
</p><div class="funcsynopsis"><a id="MaxLines"></a><p><code class="funcdef">int<strong class="fsfunc"> MaxLines</strong>(</code>Widget<var class="pdparam"> w</var>, Dimension<var class="pdparam"> height</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>height</em></span>
</span></p></td><td><p>
Specifies the height of the current drawing area.
</p></td></tr></tbody></table></div><p>
</p><p>
Returns the maximum number of lines that will fit in <span class="emphasis"><em>height</em></span>.
</p><p>
To find the height required for a given number of text lines, use
the function <a class="xref" href="#MaxHeight"><code class="function"> MaxHeight</code></a>. The TextSink already defines this
function to compute the maximum height of the window by using the
height of <code class="function">font</code>.
</p><div class="funcsynopsis"><a id="MaxHeight"></a><p><code class="funcdef">int<strong class="fsfunc"> MaxHeight</strong>(</code>Widget<var class="pdparam"> w</var>, int<var class="pdparam"> lines</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>height</em></span>
</span></p></td><td><p>
Specifies the height of the current drawing area.
</p></td></tr></tbody></table></div><p>
</p><p>
Returns the height that will be taken up by the number of lines passed.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Setting_the_Tab_Stops"></a>Setting the Tab Stops</h4></div></div></div><p>
To set the tab stops for a text sink use the <a class="xref" href="#SetTabs"><code class="function"> SetTabs</code></a> function.
The TextSink already defines this function to set the tab x location in
pixels to be the number of characters times the figure width of
<code class="function">font</code>.
</p><div class="funcsynopsis"><a id="SetTabs"></a><p><code class="funcdef">void<strong class="fsfunc"> SetTabs</strong>(</code>Widget<var class="pdparam"> w</var>, inttab_count,<var class="pdparam"> *tabs</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSink object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>tab_count</em></span>
</span></p></td><td><p>
Specifies the number of tabs passed in <span class="emphasis"><em>tabs</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>tabs</em></span>
</span></p></td><td><p>
Specifies the position, in characters, of the tab stops.
</p></td></tr></tbody></table></div><p>
</p><p>
This function is responsible for the converting character positions passed
to it into whatever internal positions the TextSink uses for tab placement.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Getting_the_Insert_Points_Size_and_Location"></a>Getting the Insert Point's Size and Location</h4></div></div></div><p>
To get the size and location of the insert point use the
<a class="xref" href="#GetCursorBounds"><code class="function"> GetCursorBounds</code></a> function.
</p><div class="funcsynopsis"><a id="GetCursorBounds"></a><p><code class="funcdef">void<strong class="fsfunc"> GetCursorBounds</strong>(</code>Widget<var class="pdparam"> w</var>, XRectangle<var class="pdparam"> *rect_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSinkObject.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>rect_return</em></span>
</span></p></td><td><p>
Returns the location and size of the insert point.
</p></td></tr></tbody></table></div><p>
</p><p>
<span class="emphasis"><em>Rect</em></span> will be filled with the current size and location of the
insert point.
</p></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="TextSrc_Object"></a>TextSrc Object</h2></div></div></div><pre class="literallayout">
Application Header file <X11/Xaw/TextSrc.h>
Class Header file <X11/Xaw/TextSrcP.h>
Class textSrcObjectClass
Class Name TextSrc
Superclass Object
</pre><p>
The TextSrc object is the root object for all text sources. Any new text
source objects should be subclasses of the TextSrc Object. The
TextSrc Class contains all methods the Text widget expects a text
source to export.
</p><p>
Since all text sources will have some resources in common the
TextSrc defines a few new resources.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="TextSource::Resources"></a>Resources</h3></div></div></div><p>
When creating an TextSrc object instance, the following resources are
retrieved from the argument list or from the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">editType</td><td align="center">EditType</td><td align="center">EditMode</td><td align="center"> </td><td align="center">NULL</td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Subclassing_the_TextSrc"></a>Subclassing the TextSrc</h3></div></div></div><p>
The only purpose of the TextSrc Object is to be subclassed. It contains
the minimum set of class methods that all text sources must have. All
class methods of the TextSrc must be defined, as the Text widget uses
them all. While all may be inherited, the direct descendant of TextSrc
<code class="function">must</code> specify some of them as TextSrc does not contain enough
information to be a valid text source by itself. Do not try to use the
TextSrc as a valid source for the Text widget; it is not intended to be
used as a source by itself and bad things will probably happen.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /></colgroup><thead><tr><th align="center">Function</th><th align="center">Inherit with</th><th align="center">Public Interface</th><th align="center">must specify</th></tr></thead><tbody><tr><td align="center">Read</td><td align="center">XtInheritRead</td><td align="center">XawTextSourceRead</td><td align="center">yes</td></tr><tr><td align="center">Replace</td><td align="center">XtInheritReplace</td><td align="center">XawTextSourceReplace</td><td align="center">no</td></tr><tr><td align="center">Scan</td><td align="center">XtInheritScan</td><td align="center">XawTextSourceScan</td><td align="center">yes</td></tr><tr><td align="center">Search</td><td align="center">XtInheritSearch</td><td align="center">XawTextSourceSearch</td><td align="center">no</td></tr><tr><td align="center">SetSelection</td><td align="center">XtInheritSetSelection</td><td align="center">XawTextSourceSetSelection</td><td align="center">no</td></tr><tr><td align="center">ConvertSelection</td><td align="center">XtInheritConvertSelection</td><td align="center">XawTextSourceConvertSelection</td><td align="center">no</td></tr></tbody></table></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Reading_Text"></a>Reading Text.</h4></div></div></div><p>
To read the text in a text source use the <a class="xref" href="#Read"><code class="function"> Read</code></a> function:
</p><div class="funcsynopsis"><a id="Read"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> Read</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> pos</var>, XawTextBlock<var class="pdparam"> *text_return</var>, int<var class="pdparam"> length</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>pos</em></span>
</span></p></td><td><p>
Specifies the position of the first character to be read from the text buffer.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>text</em></span></span></p></td><td><p>
Returns the text read from the source.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>length</em></span>
</span></p></td><td><p>
Specifies the maximum number of characters the TextSrc should
return to the application in <span class="emphasis"><em>text_return</em></span>.
</p></td></tr></tbody></table></div><p>
This function returns the text position immediately after the
characters read from the
text buffer. The function is not required to read <span class="emphasis"><em>length</em></span>
characters if that many characters are in the file, it may break at
any point that is convenient to the internal structure of the
source. It may take several calls to <a class="xref" href="#Read"><code class="function"> Read</code></a> before the desired
portion of the text buffer is fully retrieved.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="TextSource::Replacing_Text"></a>Replacing Text.</h4></div></div></div><p>
To replace or edit the text in a text buffer use the <a class="xref" href="#Replace"><code class="function"> Replace</code></a> function:
</p><div class="funcsynopsis"><a id="Replace"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> Replace</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionstart,<var class="pdparam"> end</var>, XawTextBlock<var class="pdparam"> *text</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><span class="emphasis"><em>w</em></span></span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>start</em></span></span></p></td><td><p>
Specifies the position of the first character to be removed from the text
buffer. This is also the location to begin inserting the new text.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>end</em></span></span></p></td><td><p>
Specifies the position immediately after the last character to be
removed from the text buffer.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>text</em></span></span></p></td><td><p>
Specifies the text to be added to the text source.
</p></td></tr></tbody></table></div><p>
This function can return any of the following values:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><code class="function">XawEditDone</code></span></p></td><td><p>
The text replacement was successful.
</p></td></tr><tr><td><p><span class="term"><code class="function">XawPositionError</code></span></p></td><td><p>
The edit mode is <code class="function">XawtextAppend</code> and <code class="function">start</code> is not the last
character of the source.
</p></td></tr><tr><td><p><span class="term"><code class="function">XawEditError</code></span></p></td><td><p>
Either the Source was read-only or the range to be deleted is larger
than the length of the Source.
</p></td></tr></tbody></table></div><p>
The <a class="xref" href="#Replace"><code class="function"> Replace</code></a> arguments <code class="function">start</code> and <code class="function">end</code> represent the
text source character positions for the existing text that is to be
replaced by the text in the text block. The characters from
<span class="emphasis"><em>start</em></span> up to but not including <span class="emphasis"><em>end</em></span> are deleted, and the
buffer specified by the text block is inserted in their
place. If <span class="emphasis"><em>start</em></span> and <span class="emphasis"><em>end</em></span> are equal, no text is deleted and
the new text is inserted after <span class="emphasis"><em>start</em></span>.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Scanning_the_TextSrc"></a>Scanning the TextSrc</h4></div></div></div><p>
To search the text source for one of the predefined boundary types use
the <a class="xref" href="#Scan"><code class="function"> Scan</code></a> function:
</p><div class="funcsynopsis"><a id="Scan"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> Scan</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> position</var>, XawTextScanType<var class="pdparam"> type</var>, XawTextScanDirection<var class="pdparam"> dir</var>, int<var class="pdparam"> count</var>, Boolean<var class="pdparam"> include</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><span class="emphasis"><em>w</em></span></span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>position</em></span></span></p></td><td><p>
Specifies the position to begin scanning the source.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>type</em></span></span></p></td><td><p>
Specifies the type of boundary to scan for, may be one of:
<code class="function">XawstPosition</code>, <code class="function">XawstWhiteSpace</code>, <code class="function">XawstEOL</code>,
<code class="function">XawstParagraph</code>, <code class="function">XawstAll</code>. The exact meaning of these
boundaries is left up to the individual text source.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>dir</em></span></span></p></td><td><p>
Specifies the direction to scan, may be either <code class="function">XawsdLeft</code> to search
backward, or <code class="function">XawsdRight</code> to search forward.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>count</em></span></span></p></td><td><p>
Specifies the number of boundaries to scan for.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>include</em></span></span></p></td><td><p>
Specifies whether the boundary itself should be included in the scan.
</p></td></tr></tbody></table></div><p>
The <a class="xref" href="#Scan"><code class="function"> Scan</code></a> function returns the position in the text source of the desired
boundary. It is expected to return a valid address for
all calls made to it, thus if a particular request is made that would take
the text widget beyond the end of the source it must return the
position of that end.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Searching_through_a_TextSrc"></a>Searching through a TextSrc</h4></div></div></div><p>
To search for a particular string use the <a class="xref" href="#Search"><code class="function"> Search</code></a> function.
</p><div class="funcsynopsis"><a id="Search"></a><p><code class="funcdef">XawTextPosition<strong class="fsfunc"> Search</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPosition<var class="pdparam"> position</var>, XawTextScanDirection<var class="pdparam"> dir</var>, XawTextBlock<var class="pdparam"> *text</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><span class="emphasis"><em>w</em></span></span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>position</em></span></span></p></td><td><p>
Specifies the position to begin the search.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>dir</em></span></span></p></td><td><p>
Specifies the direction to search, may be either <code class="function">XawsdLeft</code> to search
backward, or <code class="function">XawsdRight</code> to search forward.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>text</em></span></span></p></td><td><p>
Specifies a text block containing the text to search for.
</p></td></tr></tbody></table></div><p>
This function will search through the text buffer attempting to find a
match for the string in the text block. If a match is found in the
direction specified, then the character location of the first character
in the string is returned. If no text was found then
<code class="function">XawTextSearchError</code> is returned.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Text_Selections"></a>Text Selections</h4></div></div></div><p>
While many selection types are handled by the Text widget, text sources
may have selection types unknown to the Text widget. When a selection
conversion is requested by the X server the Text widget will first call
the <code class="function">ConvertSelection</code> function, to attempt the selection
conversion.
</p><div class="funcsynopsis"><a id="ConvertSelections"></a><p><code class="funcdef">Boolean<strong class="fsfunc"> ConvertSelections</strong>(</code>Widget<var class="pdparam"> w</var>, Atom*selection,*target,<var class="pdparam"> *type</var>, caddr_t<var class="pdparam"> *value_return</var>, unsignedlong<var class="pdparam"> *length_return</var>, int<var class="pdparam"> *format_return</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>selection</em></span>
</span></p></td><td><p>
Specifies the type of selection that was requested (e.g. <code class="function">PRIMARY</code>).
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>target</em></span>
</span></p></td><td><p>
Specifies the type of the selection that has been requested, which
indicates the desired information about the selection (e.g. Filename,
Text, Window).
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>type</em></span>
</span></p></td><td><p>
Specifies a pointer to the atom into which the property type of the converted
value of the selection is to be stored. For instance, either file
name or text might have property type <code class="function">XA_STRING</code>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>value_return</em></span>
</span></p></td><td><p>
Returns a pointer into which a pointer to the converted value of the
selection
is to be stored. The selection owner is responsible for allocating
this storage. The memory is considered owned by the toolkit, and is
freed by XtFree when the Intrinsics selection mechanism is done with it.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>length_return</em></span>
</span></p></td><td><p>
Returns a pointer into which the number of elements in value is to be stored.
The size of each element is determined by <span class="emphasis"><em>format</em></span>.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>format_return</em></span>
</span></p></td><td><p>
Returns a pointer into which the size in bits of the data elements of the
selection value is to be stored.
</p></td></tr></tbody></table></div><p>
If this function returns <code class="function">True</code> then the Text widget will assume
that the source has taken care of converting the selection, Otherwise the
Text widget will attempt to convert the selection itself.
</p><p>
If the source needs to know when the text selection is modified it
should define a <a class="xref" href="#SetSelection"><code class="function"> SetSelection</code></a> procedure:
</p><div class="funcsynopsis"><a id="SetSelection"></a><p><code class="funcdef">void<strong class="fsfunc"> SetSelection</strong>(</code>Widget<var class="pdparam"> w</var>, XawTextPositionstart,<var class="pdparam"> end</var>, Atom<var class="pdparam"> selection</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><span class="emphasis"><em>w</em></span></span></p></td><td><p>
Specifies the TextSrc object.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>start</em></span></span></p></td><td><p>
Specifies the character position of the beginning of the new text selection.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>end</em></span></span></p></td><td><p>
Specifies the character position of the end of the new text selection.
</p></td></tr><tr><td><p><span class="term"><span class="emphasis"><em>selection</em></span></span></p></td><td><p>
Specifies the type of selection that was requested (e.g. <code class="function">PRIMARY</code>).
</p></td></tr></tbody></table></div></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Ascii_Sink_Object_and_Multi_Sink_Object"></a>Ascii Sink Object and Multi Sink Object</h2></div></div></div><p>
</p><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/AsciiSink.h>
Class Header file <X11/Xaw/AsciiSinkP.h>
Class asciiSinkObjectClass
Class Name AsciiSink
Superclass TextSink
</pre><p>
</p><p>
The AsciiSink or MultiSink object is used by a text widget to render the text.
Depending on its <code class="function">international</code> resource, a
AsciiText widget will create one or the other of these when the AsciiText
itself is created. Both types are nearly identical; the following discussion
applies to both, with MultiSink differences noted only as they occur.
The AsciiSink
will display all printing characters in an 8 bit font, along with handling Tab
and Carriage Return. The name has been left as ``AsciiSink'' for compatibility.
\fIThe MultiSink will display all printing characters in a font set, along with
handling Tab and Carriage
Return.\fP The source object also reports the text window metrics to the
text widgets.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="AsciiSink::Resources"></a>Resources</h3></div></div></div><p>
When creating an AsciiSink object instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">displayNonprinting</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">echo</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct*</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
This resource is retrieved by the AsciiSink instead of being copied
from the Text widget.
</p><p>
The text font to use when displaying the <code class="function">string</code>.
(This resource is present in the AsciiSink, but not the MultiSink.)
</p><p>
The text font set to use when displaying the <code class="function">string</code>.
(This resource is present in the MultiSink, but not the AsciiSink.)
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Ascii_Source_Object_and_Multi_Source_Object"></a>Ascii Source Object and Multi Source Object</h2></div></div></div><p>
</p><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/AsciiSrc.h> or <X11/Xaw/MultiSrc.h>
Class Header file <X11/Xaw/AsciiSrcP.h> or <X11/Xaw/MultiSrcP.h>
Class asciiSrcObjectClass or multiSrcObjectClass
Class Name AsciiSrc or MultiSrc
Superclass TextSource
</pre><p>
</p><p>
The AsciiSrc or MultiSrc object is used by a text widget to read the text from a
file or string in memory. Depending on its <code class="function">international</code> resource, an
AsciiText widget will create one or the other of these when the AsciiText
itself is created. Both types are nearly identical; the following discussion
applies to both, with MultiSrc differences noted only as they occur.
</p><p>
The AsciiSrc understands all Latin1 characters plus Tab
and Carriage Return. \fIThe MultiSrc understands any set of character sets that
the underlying X implementation's internationalization handles.\fP
</p><p>
The AsciiSrc can be either of two types: <code class="function">XawAsciiFile</code>
or <code class="function">XawAsciiString</code>.
</p><p>
AsciiSrc objects of type <code class="function">XawAsciiFile</code> read the text from a file and
store it
into an internal buffer. This buffer may then be modified, provided the
text widget is in the correct edit mode, just as if it were a source of
type <code class="function">XawAsciiString</code>. Unlike R3 and earlier versions of the AsciiSrc,
it is now possible to specify an editable disk source. The file is not
updated, however, until a call to <a class="xref" href="#XawAsciiSave"><code class="function"> XawAsciiSave</code></a> is made. When the
source is in this mode the <code class="function">useStringInPlace</code> resource is ignored.
</p><p>
AsciiSrc objects of type <code class="function">XawAsciiString</code> have the text buffer
implemented as a string.
\fIMultiSrc objects of type <code class="function">XawAsciiString</code> have the text buffer
implemented as a wide character string.\fP
The string owner is responsible for allocating and managing storage for the
string.
</p><p>
In the default case for AsciiSrc objects of type <code class="function">XawAsciiString</code>,
the resource <code class="function">useStringInPlace</code> is false,
and the widget owns the string. The initial value of the
string resource, and any update made by the application
programmer to the string resource with <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>, is copied
into memory private to the widget, and managed internally by the widget.
The application writer
does not need to worry about running out of buffer space
(subject to the total memory available to the application).
The performance does not decay linearly as the buffer grows
large, as is necessarily the case when the text buffer is used
in place. The application writer must use <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> to
determine the contents of the text buffer, which will return
a copy of the widget's text buffer as
it existed at the time of the <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> call. This copy
is not affected by subsequent updates to the text buffer, i.e.,
it is not updated as the user types input into the text buffer.
This copy is freed upon the next call to XtGetValues to
retrieve the string resource; however, to conserve memory,
there is a convenience routine, <a class="xref" href="#XawAsciiSourceFreeString"><code class="function"> XawAsciiSourceFreeString</code></a>, allowing the
application programmer to direct the widget to free the copy.
</p><p>
When the resource <code class="function">useStringInPlace</code> is true and the AsciiSrc object
is of type <code class="function">XawAsciiString</code>, the application
is the string owner. The widget will take the value
of the string resource as its own text buffer, and the <code class="function">length</code>
resource indicates the buffer size. In this case
the buffer contents change as the user types at the widget;
it is not necessary to call <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> on the string
resource to determine the contents of the buffer-it will
simply return the address of the application's implementation
of the text buffer.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="AsciiSource::Resources"></a>Resources</h3></div></div></div><p>
When creating an AsciiSrc object instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">dataCompression</td><td align="center">DataCompression</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">editType</td><td align="center">EditType</td><td align="center">EditMode</td><td align="center"> </td><td align="center">XawtextRead</td></tr><tr><td align="center">length</td><td align="center">Length</td><td align="center">Int</td><td align="center">A</td><td align="center">length of <code class="function">string</code></td></tr><tr><td align="center">pieceSize</td><td align="center">PieceSize</td><td align="center">Int</td><td align="center"> </td><td align="center">BUFSIZ</td></tr><tr><td align="center">string</td><td align="center">String</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">type</td><td align="center">Type</td><td align="center">AsciiType</td><td align="center"> </td><td align="center">XawAsciiString</td></tr><tr><td align="center">useStringInPlace</td><td align="center">UseStringInPlace</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="AsciiSource::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
The AsciiSrc has a few convenience routines that allow the
application programmer quicker or easier access to some of the
commonly used functionality of the AsciiSrc.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Conserving_Memory"></a>Conserving Memory</h4></div></div></div><p>
When the AsciiSrc widget is not in <code class="function">useStringInPlace</code> mode
space must be allocated whenever the file is saved, or the string is
requested with a call to <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a>. This memory is allocated on the
fly, and remains valid until the next time a string needs to be allocated.
You may save memory by freeing this string as soon as you are done
with it by calling <a class="xref" href="#XawAsciiSourceFreeString"><code class="function"> XawAsciiSourceFreeString</code></a>.
</p><div class="funcsynopsis"><a id="XawAsciiSourceFreeString"></a><p><code class="funcdef">void<strong class="fsfunc"> XawAsciiSourceFreeString</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the AsciiSrc object.
</p></td></tr></tbody></table></div><p>
</p><p>
This function will free the memory that contains the string pointer returned
by <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a>. This will normally happen automatically when
the next call to <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> occurs, or when the widget is destroyed.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Saving_Files"></a>Saving Files</h4></div></div></div><p>
To save the changes made in the current text source into a file use
<a class="xref" href="#XawAsciiSave"><code class="function"> XawAsciiSave</code></a>.
</p><div class="funcsynopsis"><a id="XawAsciiSave"></a><p><code class="funcdef">Boolean<strong class="fsfunc"> XawAsciiSave</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the AsciiSrc object.
</p></td></tr></tbody></table></div><p>
</p><p>
<a class="xref" href="#XawAsciiSave"><code class="function"> XawAsciiSave</code></a> returns <code class="function">True</code> if the save was successful.
It will update the file named in the <code class="function">string</code> resource.
If the buffer has not been changed, no action will be taken. This function
only works on an AsciiSrc of type <code class="function">XawAsciiFile</code>.
</p><p>
To save the contents of the current text buffer into a named file use
<a class="xref" href="#XawAsciiSaveAsFile"><code class="function"> XawAsciiSaveAsFile</code></a>.
</p><div class="funcsynopsis"><a id="XawAsciiSaveAsFile"></a><p><code class="funcdef">Boolean<strong class="fsfunc"> XawAsciiSaveAsFile</strong>(</code>Widget<var class="pdparam"> w</var>, String<var class="pdparam"> name</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the AsciiSrc object.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>name</em></span>
</span></p></td><td><p>
The name of the file to save the current buffer into.
</p></td></tr></tbody></table></div><p>
</p><p>
This function returns <code class="function">True</code> if the save was successful.
<a class="xref" href="#XawAsciiSaveAsFile"><code class="function"> XawAsciiSaveAsFile</code></a> will work with a buffer of either type
<code class="function">XawAsciiString</code> or type <code class="function">XawAsciiFile</code>.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Seeing_if_the_Source_has_Changed"></a>Seeing if the Source has Changed</h4></div></div></div><p>
To find out if the text buffer in an AsciiSrc object has changed
since the last time it was saved with <a class="xref" href="#XawAsciiSave"><code class="function"> XawAsciiSave</code></a> or queried
use <a class="xref" href="#XawAsciiSourceChanged"><code class="function"> XawAsciiSourceChanged</code></a>.
</p><div class="funcsynopsis"><a id="XawAsciiSourceChanged"></a><p><code class="funcdef">Boolean<strong class="fsfunc"> XawAsciiSourceChanged</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the AsciiSrc object.
</p></td></tr></tbody></table></div><p>
</p><p>
This function will return <code class="function">True</code> if the source has changed since
the last time it was saved or queried. The internal change flag is
reset whenever the string is queried via <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> or the
buffer is saved via <a class="xref" href="#XawAsciiSave"><code class="function"> XawAsciiSave</code></a>.
</p></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Ascii_Text_Widget"></a>Ascii Text Widget</h2></div></div></div><p>
</p><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/AsciiText.h>
ClassHeader file <X11/Xaw/AsciiTextP.h>
Class asciiTextWidgetClass
Class Name Text
Superclass Text
Sink Name textSink
Source Name textSource
</pre><p>
</p><p>
For the ease of internationalization, the AsciiText widget class name has not
been changed, although it is actually able to support non-ASCII locales.
The AsciiText widget is really a collection of smaller parts. It
includes the Text widget itself, a ``Source'' (which supports memory management),
and a ``Sink'' (which handles the display). There are currently two supported
sources, the AsciiSrc and MultiSrc, and two supported sinks, the AsciiSink and
MultiSink. Some of
the resources listed below are not actually resources of the
AsciiText, but belong to the associated source or sink. This is
is noted in the explanation of each resource where it applies. When
specifying these resources in a resource file it is necessary to use
<span class="emphasis"><em>*AsciiText*resource_name</em></span> instead of
<span class="emphasis"><em>*AsciiText.resource_name</em></span>, since they actually belong to the
children of the AsciiText widget, and not the AsciiText widget itself.
However, these resources may be set directly on the AsciiText widget at
widget creation time, or via <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="AsciiText::Resources"></a>Resources</h3></div></div></div><p>
When creating an AsciiText widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">autoFill</td><td align="center">AutoFill</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">bottomMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">callback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">XC_xterm</td></tr><tr><td align="center">cursorName</td><td align="center">Cursor</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">dataCompression</td><td align="center">DataCompression</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">displayCaret</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">displayNonprinting</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">displayPosition</td><td align="center">TextPosition</td><td align="center">XawTextPosition</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">echo</td><td align="center">Output</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">editType</td><td align="center">EditType</td><td align="center">XawTextEditType</td><td align="center"> </td><td align="center">XawtextRead</td></tr><tr><td align="center">font</td><td align="center">Font</td><td align="center">XFontStruct*</td><td align="center"> </td><td align="center">XtDefaultFont</td></tr><tr><td align="center">fontSet</td><td align="center">FontSet</td><td align="center">XFontSet</td><td align="center"> </td><td align="center">XtDefaultFontSet</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Font height + margins</td></tr><tr><td align="center">insensitiveBorder</td><td align="center">Insensitive</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">GreyPixmap</td></tr><tr><td align="center">insertPosition</td><td align="center">TextPosition</td><td align="center">int</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">international</td><td align="center">International</td><td align="center">Boolean</td><td align="center">C</td><td align="center">False</td></tr><tr><td align="center">leftMargin</td><td align="center">Margin</td><td align="center">Dimension</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">length</td><td align="center">Length</td><td align="center">int</td><td align="center">A</td><td align="center">length of <code class="function">string</code></td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">pieceSize</td><td align="center">PieceSize</td><td align="center">XawTextPosition</td><td align="center"> </td><td align="center">BUFSIZ</td></tr><tr><td align="center">pointerColor</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">pointerColorBackground</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">resize</td><td align="center">Resize</td><td align="center">XawTextResizeMode</td><td align="center"> </td><td align="center">XawtextResizeNever</td></tr><tr><td align="center">rightMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">scrollHorizontal</td><td align="center">Scroll</td><td align="center">XawTextScrollMode</td><td align="center"> </td><td align="center">XawtextScrollNever</td></tr><tr><td align="center">scrollVertical</td><td align="center">Scroll</td><td align="center">XawTextScrollMode</td><td align="center"> </td><td align="center">XawtextScrollNever</td></tr><tr><td align="center">selectTypes</td><td align="center">SelectTypes</td><td align="center">XawTextSelectType*</td><td align="center"> </td><td align="center">See above</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">string</td><td align="center">String</td><td align="center">String</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">textSink</td><td align="center">TextSink</td><td align="center">Widget</td><td align="center"> </td><td align="center">An AsciiSink</td></tr><tr><td align="center">textSource</td><td align="center">TextSource</td><td align="center">Widget</td><td align="center"> </td><td align="center">An AsciiSrc</td></tr><tr><td align="center">topMargin</td><td align="center">Margin</td><td align="center">Position</td><td align="center"> </td><td align="center">2</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">See above</td></tr><tr><td align="center">type</td><td align="center">Type</td><td align="center">XawAsciiType</td><td align="center"> </td><td align="center">XawAsciiString</td></tr><tr><td align="center">useStringInPlace</td><td align="center">UseStringInPlace</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">100</td></tr><tr><td align="center">wrap</td><td align="center">Wrap</td><td align="center">WrapMode</td><td align="center"> </td><td align="center">XawtextWrapNever</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><p>
</p></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Composite_and_Constraint_Widgets"></a>Chapter 6. Composite and Constraint Widgets</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Box_Widget">Box Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Box::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Layout_Semantics">Layout Semantics</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Dialog_Widget">Dialog Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Dialog::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Dialog::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Automatically_Created_Children">Automatically Created Children.</a></span></dt><dt><span class="sect2"><a href="#Dialog::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Form_Widget">Form Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Form::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Form::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Form::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Form::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Paned_Widget">Paned Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Using_the_Paned_Widget">Using the Paned Widget</a></span></dt><dt><span class="sect2"><a href="#Paned::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Paned::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Paned::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Grip_Translations">Grip Translations</a></span></dt><dt><span class="sect2"><a href="#Paned::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Porthole_Widget">Porthole Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Porthole::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Porthole::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Porthole_Callbacks">Porthole Callbacks</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Tree_Widget">Tree Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Tree::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Tree::Constraint_Resources">Constraint Resources</a></span></dt><dt><span class="sect2"><a href="#Tree::Layout_Semantics">Layout Semantics</a></span></dt><dt><span class="sect2"><a href="#Tree::Convenience_Routines">Convenience Routines</a></span></dt></dl></dd><dt><span class="sect1"><a href="#Viewport_Widget">Viewport Widget</a></span></dt><dd><dl><dt><span class="sect2"><a href="#Viewport::Resources">Resources</a></span></dt><dt><span class="sect2"><a href="#Viewport::Layout_Semantics">Layout Semantics</a></span></dt></dl></dd></dl></div><p>
These widgets may contain arbitrary widget children. They implement a
policy for the size and location of their children.
</p><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">Box</span></p></td><td><p>
This widget will pack its children as tightly as possible in non-overlapping rows.
</p></td></tr><tr><td><p><span class="term">Dialog</span></p></td><td><p>
An implementation of a commonly used interaction semantic to prompt for
auxiliary input from the user, such as a filename.
</p></td></tr><tr><td><p><span class="term">Form</span></p></td><td><p>
A more sophisticated layout widget that allows the children to specify
their positions relative to the other children, or to the edges of the Form.
</p></td></tr><tr><td><p><span class="term">Paned</span></p></td><td><p>
Allows children to be tiled vertically or horizontally. Controls are
also provided to allow the user to dynamically resize the individual panes.
</p></td></tr><tr><td><p><span class="term">Porthole</span></p></td><td><p>
Allows viewing of a managed child which is as large as, or larger than its
parent, typically under control of a Panner widget.
</p></td></tr><tr><td><p><span class="term">Tree</span></p></td><td><p>
Provides geometry management of widgets arranged in a directed, acyclic graph.
</p></td></tr><tr><td><p><span class="term">Viewport</span></p></td><td><p>
Consists of a frame, one or two scrollbars, and an inner window. The
inner window can contain all the data that is to be displayed. This inner
window will be clipped by the frame with the scrollbars controlling
which section of the inner window is currently visible.
</p></td></tr></tbody></table></div><p>
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The geometry management semantics provided by the X Toolkit give full
control of the size and position of a widget to the parent of that
widget. While the children are allowed to request a certain size or
location, it is the parent who makes the final decision. Many of the
composite widgets here will deny any geometry request from their
children by default. If a child widget is not getting the expected size
or location, it is most likely the parent disallowing a request, or
implementing semantics slightly different than those expected by the
application programmer.
</p><p>
If the application wishes to change the size or location of
any widget it should make a call to <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>. This will
allow the widget to ask its parent for the new size or location.
As noted above the parent is allowed to refuse this request,
and the child must live with the result. If the
application is unable to achieve the desired semantics, then perhaps it
should use a different composite widget. Under no circumstances
should an application programmer resort to <code class="function">XtMoveWidget</code> or
<code class="function">XtResizeWidget</code>; these functions are exclusively for the use of
Composite widget implementors.
</p><p>
For more information on geometry management consult the <span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Box_Widget"></a>Box Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Box.h>
Class Header file <X11/Xaw/BoxP.h>
Class boxWidgetClass
Class Name Box
Superclass Composite
</pre><p>
</p><p>
The Box widget provides geometry management of arbitrary widgets in a
box of a specified dimension. The children are rearranged when
resizing events occur either on the Box or its children, or when
children are managed or unmanaged. The Box widget always attempts to
pack its children as tightly as possible within the geometry allowed by
its parent.
</p><p>
Box widgets are commonly used to manage a related set of buttons and
are often called ButtonBox widgets, but the children are not
limited to buttons. The Box's children are arranged on a background that
has its own specified dimensions and color.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Box::Resources"></a>Resources</h3></div></div></div><p>
When creating a Box widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">hSpace</td><td align="center">HSpace</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">orientation</td><td align="center">Orientation</td><td align="center">Orientation</td><td align="center"> </td><td align="center">XtorientVertical</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">vSpace</td><td align="center">VSpace</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">hSpace</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">vSpace</code>
</span></p></td><td><p>
The amount of space, in pixels, to leave between the children. This
resource specifies the amount of space left between the outermost
children and the edge of the box.
</p></td></tr><tr><td><p><span class="term">
<code class="function">orientation</code>
</span></p></td><td><p>
Specifies whether the preferred shape of the box (i.e. the result
returned by the query_geometry class method) is tall and narrow
<code class="function">XtorientVertical</code> or short and wide <code class="function">XtorientHorizontal</code>.
When the Box is a child of a parent which enforces width constraints, it
is usually better to specify <code class="function">XtorientVertical</code> (the default).
When the parent enforces height constraints, it is usually better to
specify <code class="function">XtorientHorizontal</code>.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
Each time a child is managed or unmanaged, the Box widget will attempt
to reposition the remaining children to compact the box. Children are
positioned in order left to right, top to bottom. The packing
algorithm used depends on the <code class="function">orientation</code> of the Box.
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">XtorientVertical</code>
</span></p></td><td><p>
When the next child does not fit on the current row, a new row is
started. If a child is wider than the width of the box, the box will
request a larger width from its parent and will begin the layout
process from the beginning if a new width is granted.
</p></td></tr><tr><td><p><span class="term">
<code class="function">XtorientHorizontal</code>
</span></p></td><td><p>
When the next child does not fit on the current row, the Box widens if
possible (so as to keep children on a single row); otherwise a new row is
started.
</p></td></tr></tbody></table></div><p>
</p><p>
After positioning all children, the Box widget attempts to shrink its
own size to the minimum dimensions required for the layout.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Dialog_Widget"></a>Dialog Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Dialog.h>
Class Header file <X11/Xaw/DialogP.h>
Class dialogWidgetClass
Class Name Dialog
Superclass Form
</pre><p>
</p><p>
The Dialog widget implements a commonly used interaction semantic to
prompt for auxiliary input from a user. For example, you can use a
Dialog widget when an application requires a small piece of information,
such as a filename, from the user. A Dialog widget, which is simply a
special case of the Form widget, provides a convenient way to create a
preconfigured form.
</p><p>
The typical Dialog widget contains three areas. The first line
contains a description of the function of the Dialog widget, for
example, the string <span class="emphasis"><em>Filename:</em></span>. The second line contains an area
into which the user types input. The third line can contain buttons
that let the user confirm or cancel the Dialog input. Any of these
areas may be omitted by the application.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Dialog::Resources"></a>Resources</h3></div></div></div><p>
When creating a Dialog widget instance, the following resources are
retrieved from the argument list or the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">defaultDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain all children</td></tr><tr><td align="center">icon</td><td align="center">Icon</td><td align="center">Bitmap</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">label</td><td align="center">Label</td><td align="center">String</td><td align="center"> </td><td align="center">"label"</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">value</td><td align="center">Value</td><td align="center">String</td><td align="center"> </td><td align="center">no value widget</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain all children</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">icon</code>
</span></p></td><td><p>
A pixmap image to be displayed immediately to the left of the
Dialog widget's label.
</p></td></tr><tr><td><p><span class="term">
<code class="function">label</code>
</span></p></td><td><p>
A string to be displayed at the top of the Dialog widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">value</code>
</span></p></td><td><p>
An initial value for the string field that the user will enter text
into. By default, no text entry field is available to the user.
Specifying an initial value for <code class="function">value</code> activates the text entry
field. If string input is desired, but no initial value is to be
specified then set this resource to "" (empty string).
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Constraint_Resources"></a>Constraint Resources</h3></div></div></div><p>
Each child of the Dialog widget may request special layout resources
be applied to it. These <span class="emphasis"><em>constraint</em></span> resources allow the Dialog
widget's children to specify individual layout requirements.
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">bottom</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">fromHoriz</td><td align="center">Widget</td><td align="center">Widget</td><td align="center"> </td><td align="center">NULL (left edge of Dialog)</td></tr><tr><td align="center">fromVert</td><td align="center">Widget</td><td align="center">Widget </td><td align="center"> </td><td align="center">NULL (top edge of Dialog)</td></tr><tr><td align="center">horizDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center"><code class="function">defaultDistance</code> resource</td></tr><tr><td align="center">left</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">resizable</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">FALSE</td></tr><tr><td align="center">right</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">top</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">vertDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center"><code class="function">defaultDistance</code> resource</td></tr></tbody></table></div><p>
</p><pre class="literallayout">
bottom
left
right
top What to do with this edge of the child when
the parent is resized. This resource may be
any edgeType. See Layout Semantics for
details.
fromHoriz
fromVert Which widget this child should be placed
underneath (or to the right of). If a value
of NULL is specified then this widget will be
positioned relative to the edge of the par-
ent.
horizDistance
vertDistance The amount of space, in pixels, between this
child and its left or upper neighbor.
resizable If this resource is False then the parent
widget will ignore all geometry request made
by this child. The parent may still resize
this child itself, however.
</pre><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Dialog::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
The Dialog widget uses two different sets of layout seman-
tics. One is used when initially laying out the children.
The other is used when the Dialog is resized.
</p><p>
The first layout method uses the <code class="function">fromVert</code> mand <code class="function">fromHoriz</code>
resources to place the children of the Dialog. A single
pass is made through the Dialog widget's children in the
order that they were created. Each child is then placed in
the Dialog widget below or to the right of the widget speci-
fied by the <code class="function">fromVert</code> mand <code class="function">fromHoriz</code> mresources. The distance
the new child is placed from its left or upper neighbor is
determined by the <code class="function">horizDistance</code> mand <code class="function">vertDistance</code> mresources.
This implies some things about how the order of creation
affects the possible placement of the children. The Form
widget registers a string to widget converter which does not
postpone conversion and does not cache conversion results.
</p><p>
The second layout method is used when the Dialog is resized.
It does not matter what causes this resize, and it is possi-
ble for a resize to happen before the widget becomes visible
(due to constraints imposed by the parent of the Dialog).
This layout method uses the <code class="function">bottom</code> ,
<code class="function">top</code> , <code class="function">left</code> , and
<code class="function">right</code>
resources. These resources are used to determine what will
happen to each edge of the child when the Dialog is resized.
If a value of <code class="function">XawChain</code>
<span class="emphasis"><em><something></em></span>
is specified, the the edge
of the child will remain a fixed distance from the <span class="emphasis"><em>chain</em></span>
edge of the Dialog. For example if <code class="function">XawChainLeft</code>
mis specified for the <code class="function">right</code> mresource of a child
then the right edge
of that child will remain a fixed distance from the left
edge of the Dialog widget. If a value of <code class="function">XawRubber</code> mis spec-
ified, that edge will grow by the same percentage that the
Dialog grew. For instance if the Dialog grows by 50% the
left edge of the child (if specified as <code class="function">XawRubber</code> mwill be
50% farther from the left edge of the Dialog). One must be
very careful when specifying these resources, for when they
are specified incorrectly children may overlap or completely
occlude other children when the Dialog widget is resized.
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Edge Type</th><th align="center">Resource Name</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">XawChainBottom</td><td align="center">ChainBottom</td><td align="center">Edge remains a fixed distance from bottom of Dialog</td></tr><tr><td align="center">XawChainLeft</td><td align="center">ChainLeft</td><td align="center">Edge remains a fixed distance from left of Dialog</td></tr><tr><td align="center">XawChainRight</td><td align="center">ChainRight</td><td align="center">Edge remains a fixed distance from right of Dialog</td></tr><tr><td align="center">XawChainTop</td><td align="center">ChainTop</td><td align="center">Edge remains a fixed distance from top of Dialog</td></tr><tr><td align="center">XawRubber</td><td align="center">Rubber</td><td align="center">Edges will move a proportional distance</td></tr></tbody></table></div><p>
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Example"></a>Example</h4></div></div></div><p>
If you wish to force the Dialog to never resize one or more of its children
then set <code class="function">left</code> and <code class="function">right</code> to <code class="function">XawChainLeft</code> and
<code class="function">top</code> and <code class="function">bottom</code> to <code class="function">XawChainTop</code>. This will cause
the child to remain a fixed distance from the top and left
edges of the Dialog, and to never resize.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Special_Considerations"></a>Special Considerations</h4></div></div></div><p>
The Dialog widget automatically sets the <code class="function">top</code> and <code class="function">bottom</code>
resources for all Children that are subclasses of the Command widget,
as well as the widget children that are used to contain the <code class="function">label</code>,
<code class="function">value</code>, and <code class="function">icon</code>. This policy allows the buttons at the
bottom of the Dialog to interact correctly with the predefined children,
and makes it possible for a client to simply create and manage a new
Command button without having to specify its constraints.
</p><p>
The Dialog will also set <code class="function">fromLeft</code> to the last button in the
Dialog for each new button added to the Dialog widget.
</p><p>
The automatically added constraints cannot be overridden, as they are
policy decisions of the Dialog widget. If a more flexible Dialog is
desired, the application is free to use the Form widget to create its
own Dialog policy.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Automatically_Created_Children"></a>Automatically Created Children.</h3></div></div></div><p>
The Dialog uses Label widgets to contain the <code class="function">label</code> and <code class="function">icon</code>.
These widgets are named <span class="emphasis"><em>label</em></span> and <span class="emphasis"><em>icon</em></span> respectively. The
Dialog <code class="function">value</code> is contained in an AsciiText widget whose name is
<code class="function">value</code>. Using <code class="function">XtNameToWidget</code> the application can change
those resources associated with each of these widgets that are not
available through the Dialog widget itself.
</p><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Dialog::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
To return the character string in the text field, use
</p><div class="funcsynopsis"><a id="XawDialogGetValueString"></a><p><code class="funcdef">String<strong class="fsfunc"> XawDialogGetValueString</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Dialog widget.
</p></td></tr></tbody></table></div><p>
</p><p>
This function returns a copy of the value string of the Dialog
widget. This string is allocated by the AsciiText widget and will
remain valid and unchanged until another call to
<a class="xref" href="#XawDialogGetValueString"><code class="function"> XawDialogGetValueString</code></a> or an <a class="xref" href="#XtGetValues"><code class="function"> XtGetValues</code></a> call on the
<code class="function">value</code> widget, when the string will be automatically freed, and
a new string is returned. This string may be freed earlier by calling
the function <a class="xref" href="#XawAsciiSourceFreeString"><code class="function"> XawAsciiSourceFreeString</code></a>.
</p><p>
To add a new button to the Dialog widget use
<a class="xref" href="#XawDialogAddButton"><code class="function"> XawDialogAddButton</code></a>.
</p><div class="funcsynopsis"><a id="XawDialogAddButton"></a><p><code class="funcdef">void<strong class="fsfunc"> XawDialogAddButton</strong>(</code>Widget<var class="pdparam"> w</var>, String<var class="pdparam"> name</var>, XtCallbackProc<var class="pdparam"> func</var>, XtPointer<var class="pdparam"> client_data</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Dialog widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>name</em></span>
</span></p></td><td><p>
Specifies the name of the new Command button to be added to the Dialog.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>func</em></span>
</span></p></td><td><p>
Specifies a callback function to be called when this button is activated. If
NULL is specified then no callback is added.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>client_data</em></span>
</span></p></td><td><p>
Specifies the client_data to be passed to the <span class="emphasis"><em>func</em></span>.
</p></td></tr></tbody></table></div><p>
</p><p>
This function is merely a shorthand for the code sequence:
</p><pre class="literallayout">
{
Widget button = XtCreateManagedWidget(name, commandWidgetClass, w, NULL, ZERO);
XtAddCallback(button, XtNcallback, func, client_data);
}
</pre><p>
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Form_Widget"></a>Form Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Form.h>
Class Header file <X11/Xaw/FormP.h>
Class formWidgetClass
Class Name Form
Superclass Constraint
</pre><p>
</p><p>
The Form widget can contain an arbitrary number of children or
subwidgets. The Form provides geometry management for its children,
which allows individual control of the position of each child. Any
combination of children can be added to a Form. The initial positions
of the children may be computed relative to the positions of previously
created children. When the Form is resized, it computes new positions and
sizes for its children. This computation is based upon information
provided when a child is added to the Form.
</p><p>
The default width of the Form is the minimum width needed to
enclose the children after computing their initial layout, with a
margin of <code class="function">defaultDistance</code>
at the right and bottom edges. If a width and height is assigned
to the Form that is too small for the layout, the children will
be clipped by the right and bottom edges of the Form.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Form::Resources"></a>Resources</h3></div></div></div><p>
When creating a Form widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">defaultDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain all children</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Enough space to contain all children</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Form::Constraint_Resources"></a>Constraint Resources</h3></div></div></div><p>
Each child of the Form widget may request special layout resources
be applied to it. These <span class="emphasis"><em>constraint</em></span> resources allow the Form
widget's children to specify individual layout requirements.
</p><p>
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">bottom</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">fromHoriz</td><td align="center">Widget</td><td align="center">Widget</td><td align="center"> </td><td align="center">NULL (left edge of Form)</td></tr><tr><td align="center">fromVert</td><td align="center">Widget</td><td align="center">Widget </td><td align="center"> </td><td align="center">NULL (top edge of Form)</td></tr><tr><td align="center">horizDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center"><code class="function">defaultDistance</code> resource</td></tr><tr><td align="center">left</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">resizable</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">FALSE</td></tr><tr><td align="center">right</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">top</td><td align="center">Edge</td><td align="center">XawEdgeType</td><td align="center"> </td><td align="center">XawRubber</td></tr><tr><td align="center">vertDistance</td><td align="center">Thickness</td><td align="center">int</td><td align="center"> </td><td align="center"><code class="function">defaultDistance</code> resource</td></tr></tbody></table></div><p>
</p><pre class="literallayout">
bottom
left
right
top What to do with this edge of the child when
the parent is resized. This resource may be
any edgeType. See Layout Semantics for
details.
fromHoriz
fromVert Which widget this child should be placed
underneath (or to the right of). If a value
of NULL is specified then this widget will be
positioned relative to the edge of the par-
ent.
horizDistance
vertDistance The amount of space, in pixels, between this
child and its left or upper neighbor.
resizable If this resource is False then the parent
widget will ignore all geometry request made
by this child. The parent may still resize
this child itself, however.
</pre></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Form::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
The Form widget uses two different sets of layout semantics.
One is used when initially laying out the children. The
other is used when the Form is resized.
</p><p>
The first layout method uses the <code class="function">fromVert</code>
and <code class="function">fromHoriz</code>
resources to place the children of the Form. A single pass
is made through the Form widget's children in the order that
they were created. Each child is then placed in the Form
widget below or to the right of the widget specified by the
<code class="function">fromVert</code> and <code class="function">fromHoriz</code>
resources. The distance the new
child is placed from its left or upper neighbor is deter-
mined by the <code class="function">horizDistance</code> and
<code class="function">vertDistance</code> resources. This
implies some things about how the order of creation affects
the possible placement of the children. The Form widget
registers a string to widget converter which does not post-
pone conversion and does not cache conversion results.
</p><p>
The second layout method is used when the Form is resized.
It does not matter what causes this resize, and it is possi-
ble for a resize to happen before the widget becomes visible
(due to constraints imposed by the parent of the Form).
This layout method uses the <code class="function">bottom</code>,
<code class="function">top</code>, <code class="function">left</code>, and
<code class="function">right</code>
resources. These resources are used to determine what will
happen to each edge of the child when the Form is resized.
If a value of <code class="function">XawChain</code>
<<span class="emphasis"><em>something</em></span>> is specified, the the edge
of the child will remain a fixed distance from the
<span class="emphasis"><em>chain</em></span>
edge of the Form. For example if <code class="function">XawChainLeft</code> is specified
for the <code class="function">right</code> resource of a child then the right edge of
that child will remain a fixed distance from the left edge
of the Form widget. If a value of <code class="function">XawRubber</code> is specified,
that edge will grow by the same percentage that the Form
grew. For instance if the Form grows by 50% the left edge
of the child (if specified as <code class="function">XawRubber</code> will be 50% farther
from the left edge of the Form). One must be very careful
when specifying these resources, for when they are specified
incorrectly children may overlap or completely occlude other
children when the Form widget is resized.
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Edge Type</th><th align="center">Resource Name</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">XawChainBottom</td><td align="center">ChainBottom</td><td align="center">Edge remains a fixed distance from bottom of Form</td></tr><tr><td align="center">XawChainLeft</td><td align="center">ChainLeft</td><td align="center">Edge remains a fixed distance from left of Form</td></tr><tr><td align="center">XawChainRight</td><td align="center">ChainRight</td><td align="center">Edge remains a fixed distance from right of Form</td></tr><tr><td align="center">XawChainTop</td><td align="center">ChainTop</td><td align="center">Edge remains a fixed distance from top of Form</td></tr><tr><td align="center">XawRubber</td><td align="center">Rubber</td><td align="center">Edges will move a proportional distance</td></tr></tbody></table></div><p>
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Form::Example"></a>Example</h4></div></div></div><p>
If you wish to force the Form to never resize one or more of its
children, then set <code class="function">left</code> and <code class="function">right</code> to <code class="function">XawChainLeft</code> and
<code class="function">top</code> and <code class="function">bottom</code> to <code class="function">XawChainTop</code>. This will cause the
child to remain a fixed distance from the top and left edges of the
Form, and never to resize.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Form::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
To force or defer a re-layout of the Form, use
</p><div class="funcsynopsis"><a id="XawFormDoLayout"></a><p><code class="funcdef">void<strong class="fsfunc"> XawFormDoLayout</strong>(</code>Widget<var class="pdparam"> w</var>, Boolean<var class="pdparam"> do_layout</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Form widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>do_layout</em></span>
</span></p></td><td><p>
Specifies whether the layout of the Form widget is enabled (<code class="function">True</code>)
or disabled (<code class="function">False</code>).
</p></td></tr></tbody></table></div><p>
</p><p>
When making several changes to the children of a Form widget
after the Form has been realized, it is a good idea to disable
relayout until after all changes have been made.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Paned_Widget"></a>Paned Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Paned.h>
Class Header file <X11/Xaw/PanedP.h>
Class panedWidgetClass
Class Name Paned
Superclass Constraint
</pre><p>
</p><p>
The Paned widget manages children in a vertically or horizontally
tiled fashion. The panes may be dynamically resized by the user by
using the <span class="emphasis"><em>grips</em></span> that appear near the right or bottom edge of the
border between two panes.
</p><p>
The Paned widget may accept any widget class as a pane <code class="function">except</code>
Grip. Grip widgets have a special meaning for the Paned widget, and
adding a Grip as its own pane will confuse the Paned widget.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Using_the_Paned_Widget"></a>Using the Paned Widget</h3></div></div></div><p>
The grips allow the panes to be resized by the user. The semantics of
how these panes resize is somewhat complicated, and warrants further
explanation here. When the mouse pointer is positioned on a grip and
pressed, an arrow is displayed that indicates the pane that is to be to
be resized. While keeping the mouse button down, the user can move the
grip up and down (or left and right). This, in turn, changes the size
of the pane. The size of the Paned widget will not change. Instead,
it chooses another pane (or panes) to resize. For more details on which
pane it chooses to resize, see <code class="function">Layout Semantics</code>.
</p><p>
One pointer binding allows the border between two panes to be moved,
without affecting any of the other panes. When this occurs the pointer
will change to an arrow that points along the pane border.
</p><p>
The default bindings for the Paned widget's grips are:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Mouse button</th><th align="center">Pane to Resize - Vertical</th><th align="center">Pane to Resize - Horizontal</th></tr></thead><tbody><tr><td align="center">1 (left)</td><td align="center">above the grip</td><td align="center">left of the grip</td></tr><tr><td align="center">2 (middle)</td><td align="center">adjust border</td><td align="center">adjust border</td></tr><tr><td align="center">3 (right)</td><td align="center">below the grip</td><td align="center">right of the grip</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Paned::Resources"></a>Resources</h3></div></div></div><p>
When creating a Paned widget instance, the following resources are
retrieved from the argument list or the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">betweenCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center">A</td><td align="center">Depends on orientation</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">cursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">None</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">gripCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center">A</td><td align="center">Depends on orientation</td></tr><tr><td align="center">gripIndent</td><td align="center">GripIndent</td><td align="center">Position</td><td align="center"> </td><td align="center">10</td></tr><tr><td align="center">gripTranslations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">see below</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Depends on orientation</td></tr><tr><td align="center">horizontalBetweenCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_up_arrow</td></tr><tr><td align="center">horizontalGripCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_h_double_arrow</td></tr><tr><td align="center">internalBorderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">internalBorderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">leftCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_left_arrow</td></tr><tr><td align="center">lowerCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_down_arrow</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">orientation</td><td align="center">Orientation</td><td align="center">Orientation</td><td align="center"> </td><td align="center">XtorientVertical</td></tr><tr><td align="center">refigureMode</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">rightCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_right_arrow</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">upperCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_up_arrow</td></tr><tr><td align="center">verticalBetweenCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_left_arrow</td></tr><tr><td align="center">verticalGripCursor</td><td align="center">Cursor</td><td align="center">Cursor</td><td align="center"> </td><td align="center">sb_v_double_arrow</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">Depends on orientation</td></tr><tr><td align="center">x</td><td align="center">Paned</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Paned</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">cursor</code>
</span></p></td><td><p>
The cursor to use when the mouse pointer is over the Paned widget, but
not in any of its children (children may also inherit this cursor). It
should be noted that the internal borders are actually part of the Paned
widget, not the children.
</p></td></tr><tr><td><p><span class="term">
<code class="function">gripCursor</code>
</span></p></td><td><p>
The cursor to use when the grips are not active. The default value is
<code class="function">verticalGripCursor</code> or <code class="function">horizontalGripCursor</code> depending on
the orientation of the Paned widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">gripIndent</code>
</span></p></td><td><p>
The amount of space left between the right (or bottom) edge of the
Paned widget and all the grips.
</p></td></tr><tr><td><p><span class="term">
<code class="function">gripTranslation</code>
</span></p></td><td><p>
Translation table that will be applied to all grips.
</p></td></tr><tr><td><p><span class="term">
<code class="function">horizontalBetweenCursor</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">verticalBetweenCursor</code>
</span></p></td><td><p>
The cursor to be used for the grip when changing the boundary between
two panes. These resources allow the cursors to be different
depending on the orientation of the Paned widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">horizontalGripCursor</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">verticalGripCursor</code>
</span></p></td><td><p>
The cursor to be used for the grips when they are not active. These
resources allow the cursors to be different depending on the
orientation of the Paned widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">internalBorderColor</code>
</span></p></td><td><p>
A pixel value which indexes the widget's colormap to derive the internal
border color of the widget's window. The class name of this resource
allows <span class="emphasis"><em>Paned*BorderColor: blue</em></span> to set the internal border color
for the Paned widget. An optimization is invoked if
<code class="function">internalBorderColor</code> and <code class="function">background</code> are the same, and the
internal borders are not drawn. <code class="function">internalBorderWidth</code> is still left
between the panes, however.
</p></td></tr><tr><td><p><span class="term">
<code class="function">internalBorderWidth</code>
</span></p></td><td><p>
The width of the internal borders. This is the amount of space left
between the panes. The class name of this resource allows
<span class="emphasis"><em>Paned*BorderWidth: 3</em></span> to set the internal border width for the
Paned widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">leftCursor</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">rightCursor</code>
</span></p></td><td><p>
The cursor used to indicate which is the <span class="emphasis"><em>important</em></span> pane to resize
when the Paned widget is oriented horizontally.
</p></td></tr><tr><td><p><span class="term">
<code class="function">lowerCursor</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">upperCursor</code>
</span></p></td><td><p>
The cursor used to indicate which is the <span class="emphasis"><em>important</em></span> pane to resize
when the Paned widget is oriented vertically.
This is not the same as the number of panes, since this also contains a
grip for some of the panes, use <a class="xref" href="#XawPanedGetNumSub"><code class="function"> XawPanedGetNumSub</code></a> to retrieve the
number of panes.
</p></td></tr><tr><td><p><span class="term">
<code class="function">orientation</code>
</span></p></td><td><p>
The orientation to stack the panes. This value can be either
<code class="function">XtorientVertical</code> or <code class="function">XtorientHorizontal</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">refigureMode</code>
</span></p></td><td><p>
This resource allows pane layout to be suspended. If this value is
<code class="function">False</code>, then no layout actions will be taken. This may improve
efficiency when adding or removing more than one pane from the Paned
widget.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Paned::Constraint_Resources"></a>Constraint Resources</h3></div></div></div><p>
Each child of the Paned widget may request special layout resources
be applied to it. These <span class="emphasis"><em>constraint</em></span> resources allow the Paned
widget's children to specify individual layout requirements.
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">allowResize</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">max</td><td align="center">Max</td><td align="center">Dimension</td><td align="center"> </td><td align="center">Infinity</td></tr><tr><td align="center">min</td><td align="center">Min</td><td align="center">Dimension</td><td align="center"> </td><td align="center">Height of Grips</td></tr><tr><td align="center">preferredPaneSize</td><td align="center">PreferredPaneSize</td><td align="center">Dimension</td><td align="center"> </td><td align="center">ask child</td></tr><tr><td align="center">resizeToPreferred</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">showGrip</td><td align="center">ShowGrip</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">skipAdjust</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">allowResize</code>
</span></p></td><td><p>
If this value is <code class="function">False</code> the the Paned widget will disallow all
geometry requests from this child.
</p></td></tr><tr><td><p><span class="term">
<code class="function">max</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">min</code>
</span></p></td><td><p>
The absolute maximum or minimum size for this pane. These values will
never be overridden by the Paned widget. This may cause some panes to be
pushed off the bottom (or right) edge of the paned widget.
</p></td></tr><tr><td><p><span class="term">
<code class="function">preferredPaneSize</code>
</span></p></td><td><p>
Normally the paned widget makes a QueryGeometry call on a child to
determine the preferred size of the child's pane. There are times
when the application programmer or the user has a better idea of the
preferred size of a pane. Setting this resource causes the value
passed to be interpreted as the preferred size, in pixels, of this pane.
</p></td></tr><tr><td><p><span class="term">
<code class="function">resizeToPreferred</code>
</span></p></td><td><p>
Determines whether or not to resize each pane to its preferred size
when the Paned widget is resized. See <code class="function">Layout Semantics</code> for details.
</p></td></tr><tr><td><p><span class="term">
<code class="function">showGrip</code>
</span></p></td><td><p>
If <code class="function">True</code> then a grip will be shown for this pane. The grip
associated with a pane is either below or to the right of the pane. No
grip is ever shown for the last pane.
</p></td></tr><tr><td><p><span class="term">
<code class="function">skipAdjust</code>
</span></p></td><td><p>
This resource is used to determine which pane is forced to be resized.
Setting this value to <code class="function">True</code> makes this pane less likely to be
forced to be resized. See <code class="function">Layout Semantics</code> for details.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Paned::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
In order to make effective use of the Paned widget it is helpful to know
the rules it uses to determine which child will be resized in any given
situation. There are three rules used to determine which child is
resized. While these rules are always the same, the panes that are
searched can change depending upon what caused the relayout.
</p><p>
<code class="function">Layout Rules</code>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">1</code>
</span></p></td><td><p>
Do not let a pane grow larger than its <code class="function">max</code> or smaller than its
<code class="function">min</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">2</code>
</span></p></td><td><p>
Do not adjust panes with <code class="function">skipAdjust</code> set.
</p></td></tr><tr><td><p><span class="term">
<code class="function">3</code>
</span></p></td><td><p>
Do not adjust panes away from their preferred size, although moving one
closer to its preferred size is fine.
</p></td></tr></tbody></table></div><p>
</p><p>
When searching the children the Paned widget looks for panes that
satisfy all the rules, and if unsuccessful then it eliminates rule 3
and then 2. Rule 1 is always enforced.
</p><p>
If the relayout is due to a resize or change in management then the
panes are searched from bottom to top. If the relayout is due to grip
movement then they are searched from the grip selected in the direction
opposite the pane selected.
</p><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Resizing_Panes_from_a_Grip_Action"></a>Resizing Panes from a Grip Action</h4></div></div></div><p>
The pane above the grip is resized by invoking the GripAction with
<code class="function">UpLeftPane</code> specified. The panes below the grip are each checked
against all rules, then rules 2 and 1 and finally against rule 1 only.
No pane above the chosen pane will ever be resized.
</p><p>
The pane below the grip is resized by invoking the GripAction with
<code class="function">LowRightPane</code> specified. The panes above the grip are each
checked in this case. No pane below the chosen pane will ever be resized.
</p><p>
Invoking GripAction with <code class="function">ThisBorderOnly</code> specified just moves the
border between the panes. No other panes are ever resized.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Resizing_Panes_after_the_Paned_widget_is_resized"></a>Resizing Panes after the Paned widget is resized.</h4></div></div></div><p>
When the Pane widget is resized it must determine a new size for each
pane. There are two methods of doing this. The Paned widget can either
give each pane its preferred size and then resize the panes to fit, or
it can use the current sizes and then resize the panes to fit. The
<code class="function">resizeToPreferred</code> resource allows the application to tell the
Paned widget whether to query the child about its preferred size
(subject to the the <code class="function">preferredPaneSize</code>) or to use the current size
when refiguring the pane locations after the pane has been resized.
</p><p>
There is one special case. All panes assume they should resize to
their preferred size until the Paned widget becomes visible to the user.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Managing_Children_and_Geometry_Management"></a>Managing Children and Geometry Management</h4></div></div></div><p>
The Paned widget always resizes its children to their preferred sizes when
a new child is managed, or a geometry management request is honored.
The Paned widget will first attempt to resize itself to contain its
panes exactly. If this is not possible then it will hunt through the
children, from bottom to top (right to left), for a pane to resize.
</p></div><div class="sect3"><div class="titlepage"><div><div><h4 class="title"><a id="Paned::Special_Considerations"></a>Special Considerations</h4></div></div></div><p>
When a user resizes a pane with the grips, the Paned widget assumes that
this new size is the preferred size of the pane.
</p></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Grip_Translations"></a>Grip Translations</h3></div></div></div><p>
The Paned widget has no action routines of its own, as all actions are
handled through the grips. The grips are each assigned a default
Translation table.
</p><p>
</p><pre class="literallayout">
<Btn1Down>: GripAction(Start, UpLeftPane)
<Btn2Down>: GripAction(Start, ThisBorderOnly)
<Btn3Down>: GripAction(Start, LowRightPane)
<Btn1Motion>: GripAction(Move, UpLeftPane)
<Btn2Motion>: GripAction(Move, ThisBorderOnly)
<Btn3Motion>: GripAction(Move, LowRightPane)
Any<BtnUp>: GripAction(Commit)
</pre><p>
</p><p>
The Paned widget interprets the <code class="function">GripAction</code> as taking two arguments.
The first argument may be any of the following:
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">Start</code>
</span></p></td><td><p>
Sets up the Paned widget for resizing and changes the cursor of the
grip. The second argument determines which pane will be resized, and
can take on any of the three values shown above.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Move</code>
</span></p></td><td><p>
The internal borders are drawn over the current pane locations to
animate where the borders would actually be placed if you were to move
this border as shown. The second argument must match the second argument
that was passed to the <code class="function">Start</code> action, that began this process. If
these arguments are not passed, the behavior is undefined.
</p></td></tr><tr><td><p><span class="term">
<code class="function">Commit</code>
</span></p></td><td><p>
This argument causes the Paned widget to commit the changes selected
by the previously started action. The cursor is changed back to the
grip's inactive cursor. No second argument is needed in this case.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Paned::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
To enable or disable a child's request for pane resizing,
use
<code class="function">XawPanedAllowResize :</code>
</p><div class="funcsynopsis"><a id="XawPanedAllowResize"></a><p><code class="funcdef">void<strong class="fsfunc"> XawPanedAllowResize</strong>(</code>Widget<var class="pdparam"> w</var>, Boolean<var class="pdparam"> allow_resize</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the child pane.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>allow_resize</em></span>
</span></p></td><td><p>
Specifies whether or not resizing requests for this child will be
granted by the Paned widget.
</p></td></tr></tbody></table></div><p>
</p><p>
If allow_resize is <code class="function">True</code>, the Paned widget allows geometry
requests from the child to change the pane's height. If allow_resize
is <code class="function">False</code>, the Paned widget ignores geometry requests from the
child to change the pane's height. The default state is <code class="function">True</code>
before the Pane is realized and <code class="function">False</code> after it is realized.
This procedure is equivalent to changing the <code class="function">allowResize</code>
constraint resource for the child.
</p><p>
To change the minimum and maximum height settings for a pane, use
<code class="function">XawPanedSetMinMax :</code>
</p><div class="funcsynopsis"><a id="XawPanedSetMinMax"></a><p><code class="funcdef">void<strong class="fsfunc"> XawPanedSetMinMax</strong>(</code>Widget<var class="pdparam"> w</var>, intmin,<var class="pdparam"> max</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the child pane.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>min</em></span>
</span></p></td><td><p>
Specifies the new minimum height of the child, expressed in pixels.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>max</em></span>
</span></p></td><td><p>
Specifies new maximum height of the child, expressed in pixels.
</p></td></tr></tbody></table></div><p>
</p><p>
This procedure is equivalent to setting the <code class="function">min</code> and <code class="function">max</code>
constraint resources for the child.
</p><p>
To retrieve the minimum and maximum height settings for a pane, use
<code class="function">XawPanedGetMinMax :</code>
</p><div class="funcsynopsis"><a id="XawPanedGetMinMax"></a><p><code class="funcdef">void<strong class="fsfunc"> XawPanedGetMinMax</strong>(</code>Widget<var class="pdparam"> w</var>, int*min_return,<var class="pdparam"> *max_return</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the child pane.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>min_return</em></span>
</span></p></td><td><p>
Returns the minimum height of the child, expressed in pixels.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>max_return</em></span>
</span></p></td><td><p>
Returns the maximum height of the child, expressed in pixels.
</p></td></tr></tbody></table></div><p>
</p><p>
This procedure is equivalent to getting the <code class="function">min</code> and <code class="function">max</code>
resources for this child child.
</p><p>
To enable or disable automatic recalculation of pane sizes and positions,
use
<code class="function">XawPanedSetRefigureMode :</code>
</p><div class="funcsynopsis"><a id="XawPanedSetRefigureMode"></a><p><code class="funcdef">void<strong class="fsfunc"> XawPanedSetRefigureMode</strong>(</code>Widget<var class="pdparam"> w</var>, Boolean<var class="pdparam"> mode</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Paned widget.
</p></td></tr><tr><td><p><span class="term">
<span class="emphasis"><em>mode</em></span>
</span></p></td><td><p>
Specifies whether the layout of the Paned widget is enabled (<code class="function">True</code>)
or disabled (<code class="function">False</code>).
</p></td></tr></tbody></table></div><p>
</p><p>
When making several changes to the children of a Paned widget
after the Paned has been realized, it is a good idea to disable
relayout until after all changes have been made.
</p><p>
To retrieve the number of panes in a paned widget use
<a class="xref" href="#XawPanedGetNumSub"><code class="function"> XawPanedGetNumSub</code></a>:
</p><div class="funcsynopsis"><a id="XawPanedGetNumSub"></a><p><code class="funcdef">int<strong class="fsfunc"> XawPanedGetNumSub</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<span class="emphasis"><em>w</em></span>
</span></p></td><td><p>
Specifies the Paned widget.
</p></td></tr></tbody></table></div><p>
</p><p>
This function returns the number of panes in the Paned widget. This is
<code class="function">not</code> the same as the number of children, since the grips are also
children of the Paned widget.
</p></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Porthole_Widget"></a>Porthole Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Porthole.h>
Class Header file <X11/Xaw/PortholeP.h>
Class portholeWidgetClass
Class Name Porthole
Superclass Composite
</pre><p>
</p><p>
The Porthole widget provides geometry management of a list of arbitrary
widgets, only one of which may be managed at any particular time.
The managed child widget is reparented within the porthole and is moved around
by the application (typically under the control of a Panner widget).
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Porthole::Resources"></a>Resources</h3></div></div></div><p>
When creating a Porthole widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">reportCallback</td><td align="center">ReportCallback</td><td align="center">Callback</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">reportCallback</code>
</span></p></td><td><p>
A list of functions to invoke whenever the managed child widget changes
size or position.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Porthole::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
The Porthole widget allows its managed child to request any size
that is as large
or larger than the Porthole itself and any location so long as the child
still obscures all of the Porthole. This widget typically is used with a
Panner widget.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Porthole_Callbacks"></a>Porthole Callbacks</h3></div></div></div><p>
The functions registered on the <code class="function">reportCallback</code> list are invoked whenever
the managed child changes size or position:
</p><div class="funcsynopsis"><a id="Porthole::ReportProc"></a><p><code class="funcdef">void<strong class="fsfunc"> ReportProc</strong>(</code>Widget<var class="pdparam"> porthole</var>, XtPointer<var class="pdparam"> client_data</var>, XtPointer<var class="pdparam"> report</var><code>)</code>;</p></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">porthole</span></p></td><td><p>
Specifies the Porthole widget.
</p></td></tr><tr><td><p><span class="term">client_data</span></p></td><td><p>
Specifies the client data.
</p></td></tr><tr><td><p><span class="term">report</span></p></td><td><p>
Specifies a pointer to an <code class="function">XawPannerReport</code> structure containing
the location and size of the slider and the size of the canvas.
</p></td></tr></tbody></table></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Tree_Widget"></a>Tree Widget</h2></div></div></div><pre class="literallayout">
Application Header file <X11/Xaw/Tree.h>
Class Header file <X11/Xaw/TreeP.h>
Class treeWidgetClass
Class Name Tree
Superclass Constraint
</pre><p>
The Tree widget provides geometry management of arbitrary widgets arranged
in a directed, acyclic graph (i.e., a tree). The hierarchy is constructed
by attaching a constraint resource called <code class="function">treeParent</code> to each widget
indicating which other node in the tree should be treated as the widget's
superior. The structure of the tree is shown by laying out the nodes
in the standard format for tree diagrams with lines drawn connecting each
node with its children.
</p><p>
The Tree sizes itself according to the needs of its children and is not
intended to be resized by its parent. Instead, it should be placed inside
another composite widget (such as the <code class="function">Porthole</code> or <code class="function">Viewport</code>)
that can be used to scroll around in the tree.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Tree::Resources"></a>Resources</h3></div></div></div><p>
When creating a Tree widget instance, the following resources are
retrieved from the argument list or from the resource database:
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">autoReconfigure</td><td align="center">AutoReconfigure</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">foreground</td><td align="center">Foreground</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">gravity</td><td align="center">Gravity</td><td align="center">XtGravity</td><td align="center"> </td><td align="center">WestGravity</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">hSpace</td><td align="center">HSpace</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">lineWidth</td><td align="center">LineWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">vSpace</td><td align="center">VSpace</td><td align="center">Dimension</td><td align="center"> </td><td align="center">4</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center">A</td><td align="center">see <code class="function">Layout Semantics</code></td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr></tbody></table></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><code class="function">autoReconfigure</code></span></p></td><td><p>
Whether or not to layout the tree every time a node is added or removed.
</p></td></tr><tr><td><p><span class="term"><code class="function">gravity</code></span></p></td><td><p>
Specifies the side of the widget from which the tree should grow. Valid
values include <code class="function">WestGravity</code>, <code class="function">NorthGravity</code>, <code class="function">EastGravity</code>, and
<code class="function">SouthGravity</code>.
</p></td></tr><tr><td><p><span class="term"><code class="function">hSpace</code></span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term"><code class="function">vSpace</code></span></p></td><td><p>
The amount of space, in pixels, to leave between the children. This
resource specifies the amount of space left between the outermost
children and the edge of the box.
</p></td></tr><tr><td><p><span class="term"><code class="function">lineWidth</code></span></p></td><td><p>
The width of the lines from nodes that do not have a <code class="function">treeGC</code>
constraint resource to their children.
</p></td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Tree::Constraint_Resources"></a>Constraint Resources</h3></div></div></div><p>
Each child of the Tree widget must specify its superior node in the tree. In
addition, it may specify a GC to use when drawing a line between it and its
inferior nodes.
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">treeGC</td><td align="center">TreeGC</td><td align="center">GC</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">treeParent</td><td align="center">TreeParent</td><td align="center">Widget</td><td align="center"> </td><td align="center">NULL</td></tr></tbody></table></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term"><code class="function">treeGC</code></span></p></td><td><p>
This specifies the GC to use when drawing lines between this widget and its
inferiors in the tree. If this resource is not specified, the Tree's
<code class="function">foreground</code> and <code class="function">lineWidth</code> will be used.
</p></td></tr><tr><td><p><span class="term"><code class="function">treeParent</code></span></p></td><td><p>
This specifies the superior node in the tree for this widget. The default is
for the node to have no superior (and to therefore be at the top of the tree).
</p></td></tr></tbody></table></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Tree::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
Each time a child is managed or unmanaged, the Tree widget will attempt
to reposition the remaining children to fix the shape of the tree if the
resource is set. Children at the top (most superior) of the tree are
drawn at the side specified by the resource.
</p><p>
After positioning all children, the Tree widget attempts to shrink its
own size to the minimum dimensions required for the layout.
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Tree::Convenience_Routines"></a>Convenience Routines</h3></div></div></div><p>
The most efficient way to layout a tree is to set
<code class="function">autoReconfigure</code>
to False and then use the
<a class="xref" href="#XawTreeForceLayout"><code class="function"> XawTreeForceLayout</code></a>
routine to arrange the children.
</p><div class="funcsynopsis"><a id="XawTreeForceLayout"></a><p><code class="funcdef">void<strong class="fsfunc"> XawTreeForceLayout</strong>(</code>Widget<var class="pdparam"> w</var><code>)</code>;</p></div><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">w</span></p></td><td><p>
Specifies the Tree widget.
</p></td></tr></tbody></table></div></div></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Viewport_Widget"></a>Viewport Widget</h2></div></div></div><p>
</p><pre class="literallayout">
Application Header file <X11/Xaw/Viewport.h>
Class Header file <X11/Xaw/ViewportP.h>
Class viewportWidgetClass
Class Name Viewport
Superclass Form
</pre><p>
</p><p>
The Viewport widget consists of a frame window, one or two Scrollbars,
and an inner window. The size of the frame window is determined by the
viewing size of the data that is to be displayed and the dimensions to
which the Viewport is created. The inner window is the full size of the
data that is to be displayed and is clipped by the frame window. The
Viewport widget controls the scrolling of the data directly. No
application callbacks are required for scrolling.
</p><p>
When the geometry of the frame window is equal in size to the inner
window, or when the data does not require scrolling, the Viewport widget
automatically removes any scrollbars. The <code class="function">forceBars</code> option causes
the Viewport widget to display all scrollbars permanently.
</p><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Viewport::Resources"></a>Resources</h3></div></div></div><p>
When creating a Viewport widget instance, the following resources are
retrieved from the argument list or the resource database:
</p><p>
</p><div class="informaltable"><table border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /><col align="center" class="c4" /><col align="center" class="c5" /></colgroup><thead><tr><th align="center">Name</th><th align="center">Class</th><th align="center">Type</th><th align="center">Notes</th><th align="center">Default Value</th></tr></thead><tbody><tr><td align="center">accelerators</td><td align="center">Accelerators</td><td align="center">AcceleratorTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">allowHoriz</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">allowVert</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">ancestorSensitive</td><td align="center">AncestorSensitive</td><td align="center">Boolean</td><td align="center">D</td><td align="center">True</td></tr><tr><td align="center">background</td><td align="center">Background</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultBackground</td></tr><tr><td align="center">backgroundPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderColor</td><td align="center">BorderColor</td><td align="center">Pixel</td><td align="center"> </td><td align="center">XtDefaultForeground</td></tr><tr><td align="center">borderPixmap</td><td align="center">Pixmap</td><td align="center">Pixmap</td><td align="center"> </td><td align="center">XtUnspecifiedPixmap</td></tr><tr><td align="center">borderWidth</td><td align="center">BorderWidth</td><td align="center">Dimension</td><td align="center"> </td><td align="center">1</td></tr><tr><td align="center">children</td><td align="center">ReadOnly</td><td align="center">WidgetList</td><td align="center">R</td><td align="center">NULL</td></tr><tr><td align="center">colormap</td><td align="center">Colormap</td><td align="center">Colormap</td><td align="center"> </td><td align="center">Parent's Colormap</td></tr><tr><td align="center">depth</td><td align="center">Depth</td><td align="center">int</td><td align="center">C</td><td align="center">Parent's Depth</td></tr><tr><td align="center">destroyCallback</td><td align="center">Callback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">forceBars</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">height</td><td align="center">Height</td><td align="center">Dimension</td><td align="center"> </td><td align="center">height of the child</td></tr><tr><td align="center">mappedWhenManaged</td><td align="center">MappedWhenManaged</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">numChildren</td><td align="center">ReadOnly</td><td align="center">Cardinal</td><td align="center">R</td><td align="center">0</td></tr><tr><td align="center">reportCallback</td><td align="center">ReportCallback</td><td align="center">XtCallbackList</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">screen</td><td align="center">Screen</td><td align="center">Screen</td><td align="center">R</td><td align="center">Parent's Screen</td></tr><tr><td align="center">sensitive</td><td align="center">Sensitive</td><td align="center">Boolean</td><td align="center"> </td><td align="center">True</td></tr><tr><td align="center">translations</td><td align="center">Translations</td><td align="center">TranslationTable</td><td align="center"> </td><td align="center">NULL</td></tr><tr><td align="center">useBottom</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">useRight</td><td align="center">Boolean</td><td align="center">Boolean</td><td align="center"> </td><td align="center">False</td></tr><tr><td align="center">width</td><td align="center">Width</td><td align="center">Dimension</td><td align="center"> </td><td align="center">width of the child</td></tr><tr><td align="center">x</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">y</td><td align="center">Position</td><td align="center">Position</td><td align="center"> </td><td align="center">0</td></tr><tr><td align="center">_</td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div><p>
</p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top" /><col /></colgroup><tbody><tr><td><p><span class="term">
<code class="function">allowHoriz</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">allowVert</code>
</span></p></td><td><p>
If these resources are <code class="function">False</code> then the Viewport will never create
a scrollbar in this direction. If it is <code class="function">True</code> then the scrollbar will
only appear when it is needed, unless <code class="function">forceBars</code> is <code class="function">True</code>.
</p></td></tr><tr><td><p><span class="term">
<code class="function">forceBars</code>
</span></p></td><td><p>
When <code class="function">True</code> the scrollbars that have been <span class="emphasis"><em>allowed</em></span> will always be
visible on the screen. If <code class="function">False</code> the scrollbars will be visible only
when the inner window is larger than the frame.
</p></td></tr><tr><td><p><span class="term">
<code class="function">reportCallback</code>
</span></p></td><td><p>
These callbacks will be executed whenever the Viewport adjusts the viewed
area of the child. The call_data parameter is a pointer to an XawPannerReport
structure.
</p></td></tr><tr><td><p><span class="term">
<code class="function">useBottom</code>
</span></p></td><td><p>
</p></td></tr><tr><td><p><span class="term">
<code class="function">useRight</code>
</span></p></td><td><p>
By default the scrollbars appear on the left and top of the screen.
These resources allow the vertical scrollbar to be placed on the right
edge of the Viewport, and the horizontal scrollbar on the bottom edge of
the Viewport.
</p></td></tr></tbody></table></div><p>
</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="Viewport::Layout_Semantics"></a>Layout Semantics</h3></div></div></div><p>
The Viewport widget manages a single child widget. When the size of the
child is larger than the size of the Viewport, the user can interactively
move the child within the Viewport by repositioning the scrollbars.
</p><p>
The default size of the Viewport before it is realized is the width and/or
height of the child. After it is realized, the Viewport will allow its
child to grow vertically or horizontally if <code class="function">allowVert</code> or
<code class="function">allowHoriz</code> are set, respectively. If the corresponding vertical
or horizontal scrollbar is not enabled, the Viewport will propagate the
geometry request to its own parent and the child will be allowed to change
size only if the Viewport's parent allows it. Regardless of whether or not
scrollbars are enabled in the corresponding direction, if the child requests
a new size smaller than the Viewport size, the change will be allowed only
if the parent of the Viewport allows the Viewport to shrink to the
appropriate dimension.
</p><p>
The scrollbar children of the Viewport are named <code class="function">horizontal</code> and
<code class="function">vertical</code>. By using these names the programmer can specify resources
for the individual scrollbars. <a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a> can be used to modify
the resources dynamically once the widget ID has been obtained with
<code class="function">XtNameToWidget</code>.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Although the Viewport is a Subclass of the Form, no resources for the Form
may be supplied for any of the children of the Viewport. These constraints
are managed internally and are not meant for public consumption.
</p></div></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="Creating_New_Widgets_Subclassing"></a>Chapter 7. Creating New Widgets (Subclassing)</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="#Public_Header_File">Public Header File</a></span></dt><dt><span class="sect1"><a href="#Private_Header_File">Private Header File</a></span></dt><dt><span class="sect1"><a href="#Widget_Source_File">Widget Source File</a></span></dt></dl></div><p>
Although the task of creating a new widget may at first appear a little
daunting, there is a basic simple pattern that all widgets follow. The
Athena Widget library contains a special widget called the
<span class="emphasis"><em>Template</em></span> widget that is intended to assist
the novice widget programmer in writing a custom widget.
</p><p>
Reasons for wishing to write a custom widget include:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Providing a graphical interface not currently supported by any existing
widget set.
</p></li><li class="listitem"><p>
Convenient access to resource management procedures to obtain fonts,
colors, etc., even if user customization is not desired.
</p></li><li class="listitem"><p>
Convenient access to user input dispatch and translation management procedures.
</p></li><li class="listitem"><p>
Access to callback mechanism for building higher-level application libraries.
</p></li><li class="listitem"><p>
Customizing the interface or behavior of an existing widget to suit a
special application need.
</p></li><li class="listitem"><p>
Desire to allow user customization of resources such as fonts, colors,
etc., or to allow convenient re-binding of keys and buttons to internal
functions.
</p></li><li class="listitem"><p>
Converting a non-Toolkit application to use the Toolkit.
</p></li></ul></div><p>
In each of these cases, the operation needed to create a new widget is
to "subclass" an existing one. If the desired semantics of the new
widget are similar to an existing one, then the implementation of the
existing widget should be examined to see how much work would be
required to create a subclass that will then be
able to share the existing class methods. Much time will be saved in
writing the new widget if an existing widget class Expose, Resize and/or
GeometryManager method can be used by the subclass.
</p><p>
Note that some trivial uses of a ``bare-bones'' widget may be achieved by
simply creating an instance of the Core
widget. The class variable to use when creating a Core widget is
<code class="function">widgetClass</code>.
The geometry of the Core widget is determined entirely by the parent
widget.
</p><p>
It is very often the case than an application will have a special need
for a certain set of functions and that many copies of these functions
will be needed. For example, when converting an older application to use
the Toolkit, it may be desirable to have a "Window Widget" class that
might have the following semantics:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
Allocate 2 drawing colors in addition to a background color.
</p></li><li class="listitem"><p>
Allocate a text font.
</p></li><li class="listitem"><p>
Execute an application-supplied function to handle exposure events.
</p></li><li class="listitem"><p>
Execute an application-supplied function to handle user input events.
</p></li></ul></div><p>
It is obvious that a completely general-purpose WindowWidgetClass could
be constructed that would export all class methods as callbacks lists,
but such a widget would be very large and would have to choose some
arbitrary number of resources such as colors to allocate. An application
that used many instances of the general-purpose widget would therefore
un-necessarily waste many resources.
</p><p>
In this section, an outline will be given of the procedure to follow to
construct a special-purpose widget to address the items listed above.
The reader should refer to the appropriate sections of the
<span class="emphasis"><em>X Toolkit Intrinsics - C Language Interface</em></span>
for complete details of the material outlined here. Section 1.4 of
the <span class="emphasis"><em>Intrinsics</em></span> should be read in
conjunction with this section.
</p><p>
All Athena widgets have three separate files associated with them:
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
A "public" header file containing declarations needed by applications programmers
</p></li><li class="listitem"><p>
A "private" header file containing additional declarations needed by the
widget and any subclasses
</p></li><li class="listitem"><p>
A source code file containing the implementation of the widget
</p></li></ul></div><p>
This separation of functions into three files is suggested for all
widgets, but nothing in the Toolkit actually requires this format. In
particular, a private widget created for a single application may easily
combine the "public" and "private" header files into a single file, or
merge the contents into another application header file. Similarly, the
widget implementation can be merged into other application code.
</p><p>
In the following example, the public header file
<code class="function">< X11/Xaw/Template.h ></code>,
the private header file
<code class="function">< X11/Xaw/TemplateP.h ></code>
and the source code file
<code class="function">< X11/Xaw/Template.c ></code>
will be modified to produce the "WindowWidget" described above.
In each case, the files have been designed so that a global string
replacement of "Template" and "template"
with the name of your new widget, using
the appropriate case, can be done.
</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Public_Header_File"></a>Public Header File</h2></div></div></div><p>
The public header file contains declarations that will be required by any
application module that needs to refer to the widget; whether to create
an instance of the class, to perform an
<a class="xref" href="#XtSetValues"><code class="function"> XtSetValues</code></a>
operation, or to call a public routine implemented by the widget class.
</p><p>
The contents of the Template public header file,
<code class="function">< X11/Xaw/Template.h >, </code>
are:
</p><pre class="literallayout">
..
/* Copyright (c) X Consortium 1987, 1988 */
#ifndef _Template_h
#define _Template_h
/****************************************************************
*
* Template widget
*
****************************************************************/
/* Resources:
Name Class RepType Default Value
---- ----- ------- -------------
background Background Pixel XtDefaultBackground
border BorderColor Pixel XtDefaultForeground
borderWidth BorderWidth Dimension 1
destroyCallback Callback Pointer NULL
height Height Dimension 0
mappedWhenManaged MappedWhenManaged Boolean True
sensitive Sensitive Boolean True
width Width Dimension 0
x Position Position 0
y Position Position 0
*/
/* define any special resource names here that are not in <X11/StringDefs.h> */
#define XtNtemplateResource "templateResource"
#define XtCTemplateResource "TemplateResource"
/* declare specific TemplateWidget class and instance datatypes */
typedef struct _TemplateClassRec* TemplateWidgetClass;
typedef struct _TemplateRec* TemplateWidget;
/* declare the class constant */
extern WidgetClass templateWidgetClass;
#endif /* _Template_h */
</pre><p>
You will notice that most of this file is documentation. The crucial
parts are the last 8 lines where macros for any private resource names
and classes are defined and where the widget class datatypes and class
record pointer are declared.
</p><p>
For the "WindowWidget", we want 2 drawing colors, a callback list for
user input and an
<code class="function">exposeCallback</code> callback list, and we will declare three
convenience procedures, so we need to add
</p><pre class="literallayout">
/* Resources:
...
callback Callback Callback NULL
drawingColor1 Color Pixel XtDefaultForeground
drawingColor2 Color Pixel XtDefaultForeground
exposeCallback Callback Callback NULL
font Font XFontStruct* XtDefaultFont
...
*/
#define XtNdrawingColor1 "drawingColor1"
#define XtNdrawingColor2 "drawingColor2"
#define XtNexposeCallback "exposeCallback"
extern Pixel WindowColor1(\|/* Widget */\|);
extern Pixel WindowColor2(\|/* Widget */\|);
extern Font\ \ WindowFont(\|/* Widget */\|);
</pre><p>
Note that we have chosen to call the input callback list by the generic
name, <code class="function">callback</code>, rather than a specific name. If widgets that define
a single user-input action all choose the same resource name then there
is greater possibility for an application to switch between widgets of
different types.
</p></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Private_Header_File"></a>Private Header File</h2></div></div></div><p>
The private header file contains the complete declaration of the class
and instance structures for the widget and any additional private data
that will be required by anticipated subclasses of the widget.
Information in the private header file is normally hidden from the
application and is designed to be accessed only through other public
procedures; e.g.
<code class="function">XtSetValues .</code>
</p><p>
The contents of the Template private header file,
<code class="function">< X11/Xaw/TemplateP.h >, </code>
are:
</p><pre class="literallayout">
/* Copyright (c) X Consortium 1987, 1988
*/
#ifndef _TemplateP_h
#define _TemplateP_h
#include <X11/Xaw/Template.h>
/* include superclass private header file */
#include <X11/CoreP.h>
/* define unique representation types not found in <X11/StringDefs.h> */
#define XtRTemplateResource "TemplateResource"
typedef struct {
int empty;
} TemplateClassPart;
typedef struct _TemplateClassRec {
CoreClassPart core_class;
TemplateClassPart template_class;
} TemplateClassRec;
extern TemplateClassRec templateClassRec;
typedef struct {
/* resources */
char* resource;
/* private state */
} TemplatePart;
typedef struct _TemplateRec {
CorePart core;
TemplatePart template;
} TemplateRec;
#endif /* _TemplateP_h */
</pre><p>
The private header file includes the private header file of its
superclass, thereby exposing the entire internal structure of the widget.
It may not always be advantageous to do this; your own project
development style will dictate the appropriate level of detail to expose
in each module.
</p><p>
The "WindowWidget" needs to declare two fields in its instance structure to
hold the drawing colors, a resource field for the font and a field for the
expose and user input callback lists:
</p><pre class="literallayout">
typedef struct {
/* resources */
Pixel color_1;
Pixel color_2;
XFontStruct* font;
XtCallbackList expose_callback;
XtCallbackList input_callback;
/* private state */
/* (none) */
} WindowPart;
</pre></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Widget_Source_File"></a>Widget Source File</h2></div></div></div><p>
The source code file implements the widget class itself. The unique
part of this file is the declaration and initialization of the
widget class record structure and the declaration of all resources and
action routines added by the widget class.
</p><p>
The contents of the Template implementation file,
<code class="function">< X11/Xaw/Template.c >,</code>
are:
</p><pre class="literallayout">
/* Copyright (c) X Consortium 1987, 1988
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include "TemplateP.h"
static XtResource resources[] = {
#define offset(field) XtOffsetOf(TemplateRec, template.field)
/* {name, class, type, size, offset, default_type, default_addr}, */
{ XtNtemplateResource, XtCTemplateResource, XtRTemplateResource,
sizeof(char*), offset(resource), XtRString, (XtPointer) "default" },
#undef offset
};
static void TemplateAction(/* Widget, XEvent*, String*, Cardinal* */);
static XtActionsRec actions[] =
{
/* {name, procedure}, */
{"template", TemplateAction},
};
static char translations[] =
" <Key>: template(\|) \\n\\
";
TemplateClassRec templateClassRec = {
{ /* core fields */
/* superclass */ (WidgetClass) &widgetClassRec,
/* class_name */ "Template",
/* widget_size */ sizeof(TemplateRec),
/* class_initialize */ NULL,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ NULL,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ actions,
/* num_actions */ XtNumber(actions),
/* resources */ resources,
/* num_resources */ XtNumber(resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ NULL,
/* expose */ NULL,
/* set_values */ NULL,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ translations,
/* query_geometry */ XtInheritQueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
{ /* template fields */
/* empty */ 0
}
};
WidgetClass templateWidgetClass = (WidgetClass)&templateClassRec;
</pre><p>
The resource list for the "WindowWidget" might look like the following:
</p><pre class="literallayout">
static XtResource resources[] = {
#define offset(field) XtOffsetOf(WindowWidgetRec, window.field)
/* {name, class, type, size, offset, default_type, default_addr}, */
{ XtNdrawingColor1, XtCColor, XtRPixel, sizeof(Pixel),
offset(color_1), XtRString, XtDefaultForeground },
{ XtNdrawingColor2, XtCColor, XtRPixel, sizeof(Pixel),
offset(color_2), XtRString, XtDefaultForeground },
{ XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),
offset(font), XtRString, XtDefaultFont },
{ XtNexposeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
offset(expose_callback), XtRCallback, NULL },
{ XtNcallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
offset(input_callback), XtRCallback, NULL },
#undef offset
};
</pre><p>
The user input callback will be implemented by an action procedure which
passes the event pointer as call_data. The action procedure
is declared as:
</p><pre class="literallayout">
/* ARGSUSED */
static void InputAction(w, event, params, num_params)
Widget w;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
{
XtCallCallbacks(w, XtNcallback, (XtPointer)event);
}
static XtActionsRec actions[] =
{
/* {name, procedure}, */
{"input", InputAction},
};
</pre><p>
and the default input binding will be to execute the input callbacks on
<code class="function">KeyPress</code> and <code class="function">ButtonPress : </code>
</p><pre class="literallayout">
static char translations[] =
" <Key>: input(\|) \\n\\
<BtnDown>: input(\|) \\
";
</pre><p>
In the class record declaration and initialization, the only field that
is different from the Template is the expose procedure:
</p><pre class="literallayout">
/* ARGSUSED */
static void Redisplay(w, event, region)
Widget w;
XEvent *event; /* unused */
Region region;
{
XtCallCallbacks(w, XtNexposeCallback, (XtPointer)region);
}
WindowClassRec windowClassRec = {
...
/* expose */ Redisplay,
</pre><p>
The "WindowWidget" will also declare three public procedures to return the
drawing colors and the font id, saving the application the effort of
constructing an argument list for a call to
<code class="function">XtGetValues :</code>
</p><pre class="literallayout">
Pixel WindowColor1(w)
Widget w;
{
return ((WindowWidget)w)->window.color_1;
}
Pixel WindowColor2(w)
Widget w;
{
return ((WindowWidget)w)->window.color_2;
}
Font WindowFont(w)
Widget w;
{
return ((WindowWidget)w)->window.font->fid;
}
</pre><p>
The "WindowWidget" is now complete. The application can retrieve the two
drawing colors from the widget instance by calling either
<code class="function">XtGetValues ,</code>
or the <code class="function">WindowColor</code> functions. The actual window created for the
"WindowWidget" is available by calling the
<code class="function">XtWindow</code> function.
</p></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="idp49380912"></a>Chapter 8. Acknowledgments</h1></div></div></div><p>
Many thanks go to Ralph Swick (Project Athena / Digital) who has
contributed much time and effort to this widget set. Previous
versions of the widget set are largely due to his time and effort.
Many of the improvements that I have been able to make are because he
provided a solid foundation to build upon. While much of the effort
has been Ralph's, many other people have contributed to the code.
</p><pre class="literallayout">
Mark Ackerman (formerly Project Athena)
Donna Converse (MIT X Consortium)
Jim Fulton (formerly MIT X Consortium)
Loretta Guarino-Reid (Digital WSL)
Charles Haynes (Digital WSL)
Rich Hyde (Digital WSL)
Mary Larson (Digital UEG)
Joel McCormack (Digital WSL)
Ron Newman (formerly Project Athena)
Jeanne Rich (Digital WSL)
Terry Weissman (formerly Digital WSL)
</pre><p>
While not much remains of the X10 toolkit, many of the ideas for this
widget set come from that original version. The design and
implementation of the X10 toolkit were done by:
</p><pre class="literallayout">
Mike Gancarz (formerly Digital UEG)
Charles Haynes (Digital WSL)
Phil Karlton (formerly Digital WSL)
Kathleen Langone (Digital UEG)
Mary Larson (Digital UEG)
Ram Rao (Digital UEG)
Smokey Wallace (formerly Digital WSL)
Terry Weissman (formerly Digital WSL)
</pre><p>
I have used the formatting ideas, and some of the words from previous
versions of this document. The X11R3 Athena widget document was written by:
</p><pre class="literallayout">
Ralph R. Swick (Project Athena/ Digital)
Terry Weissman (formerly Digital WSL)
Al Mento (Digital UEG)
</pre><p>
Putting this manual together was a major task in and of itself. I
would like to thank Ralph Swick, Donna Converse, and Jim Fulton for
taking the time to help convert my technical knowledge into legible
text. A special thanks to Jean Diaz (O'Reilly and Associates) for
spending nearly a month with me working out all the annoying little
details.
</p><pre class="literallayout">
Chris D. Peterson
MIT X Consortium 1989
</pre><p>
The R5 edition of this document has been edited by the research staff of
the MIT X Consortium, with significant contributions by Jim Fulton (NCD).
</p><pre class="literallayout">
Donna Converse
MIT X Consortium 1991
</pre><p>
The R6 edition of this document has been edited to reflect changes
brought about by research staff of the Omron Corporation, with special
recognition to Li Yuhong, Seiji Kuwari, and Hiroshi Kuribayashi for
the X11R5/contrib/lib/Xaw internationalization that inspired this version.
</p><pre class="literallayout">
Frank Sheeran
Omron Corporation 1994
</pre></div></div></body></html>
|