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
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtkcontainer">
<refnamediv>
<refname>gtk.Container</refname>
<refpurpose>a base class for widgets that contain other
widgets</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtk.Container</classname></ooclass>
<ooclass><classname><link
linkend="class-gtkwidget">gtk.Widget</link></classname></ooclass>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-border-width">set_border_width</link></methodname>
<methodparam><parameter
role="keyword">border_width</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-border-width">get_border_width</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--add">add</link></methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--remove">remove</link></methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-resize-mode">set_resize_mode</link></methodname>
<methodparam><parameter
role="keyword">resize_mode</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-resize-mode">get_resize_mode</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--check-resize">check_resize</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--forall">forall</link></methodname>
<methodparam><parameter
role="keyword">callback</parameter></methodparam>
<methodparam><parameter
role="keyword">callback_data</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--foreach">foreach</link></methodname>
<methodparam><parameter
role="keyword">callback</parameter></methodparam>
<methodparam><parameter
role="keyword">callback_data</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-children">get_children</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--propagate-expose">propagate_expose</link></methodname>
<methodparam><parameter
role="keyword">child</parameter></methodparam>
<methodparam><parameter
role="keyword">event</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-focus-chain">set_focus_chain</link></methodname>
<methodparam><parameter
role="keyword">focusable_widgets</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-focus-chain">get_focus_chain</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--unset-focus-chain">unset_focus_chain</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-reallocate-redraws">set_reallocate_redraws</link></methodname>
<methodparam><parameter
role="keyword">needs_redraws</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-focus-child">set_focus_child</link></methodname>
<methodparam><parameter
role="keyword">child</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-focus-child">get_focus_child</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-focus-vadjustment">set_focus_vadjustment</link></methodname>
<methodparam><parameter
role="keyword">adjustment</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-focus-vadjustment">get_focus_vadjustment</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--set-focus-hadjustment">set_focus_hadjustment</link></methodname>
<methodparam><parameter
role="keyword">adjustment</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--get-focus-hadjustment">get_focus_hadjustment</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--resize-children">resize_children</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--child-type">child_type</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--add-with-properties">add_with_properties</link></methodname>
<methodparam><parameter>widget</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>first_prop_value</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--child-set">child_set</link></methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>first_prop_value</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--child-get">child_get</link></methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--child-set-property">child_set_property</link></methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>property_name</parameter></methodparam>
<methodparam><parameter>value</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkcontainer--child-get-property">child_get_property</link></methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>property_name</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<programlisting>
<emphasis role="bold">Class Methods</emphasis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkcontainer--install-child-property">install_child_property</link></methodname>
<methodparam><parameter role="keyword">property_id</parameter></methodparam>
<methodparam><parameter role="keyword">pspec</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="method-gtkcontainer--list-child-properties">list_child_properties</link></methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<programlisting>
<emphasis role="bold">Functions</emphasis>
<methodsynopsis language="python">
<methodname><link linkend="function-gtk--container-class-install-child-property">gtk.container_class_install_child_property</link></methodname>
<methodparam><parameter role="keyword">klass</parameter></methodparam>
<methodparam><parameter role="keyword">property_id</parameter></methodparam>
<methodparam><parameter role="keyword">pspec</parameter></methodparam>
</methodsynopsis><methodsynopsis language="python">
<methodname><link linkend="function-gtk--container-class-list-child-properties">gtk.container_class_list_child_properties</link></methodname>
<methodparam><parameter role="keyword">klass</parameter></methodparam>
</methodsynopsis></programlisting>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
+-- <link linkend="class-gtkobject">gtk.Object</link>
+-- <link linkend="class-gtkwidget">gtk.Widget</link>
+-- <link linkend="class-gtkcontainer">gtk.Container</link>
</synopsis>
</refsect1>
<refsect1>
<title>Implemented Interfaces</title>
<para>
<link linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
implements
<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
</para>
</refsect1>
<refsect1 id="properties-gtkcontainer">
<title>gtk.Container Properties</title>
<para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
<para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="3.5in"/>
<tbody>
<row valign="top">
<entry>"border-width"</entry>
<entry>Read/Write</entry>
<entry>The width of the empty border outside the containers
children.</entry>
</row>
<row valign="top">
<entry>"child"</entry>
<entry>Write</entry>
<entry>The child widget in the container</entry>
</row>
<row valign="top">
<entry>"resize-mode"</entry>
<entry>Read/Write</entry>
<entry>Specify how resize events are handled. One of:
<literal>gtk.RESIZE_PARENT</literal>,
<literal>gtk.RESIZE_QUEUE</literal> or
<literal>gtk.RESIZE_IMMEDIATE</literal></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="style-properties-gtkcontainer">
<title>gtk.Container Style Properties</title>
<para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>
</refsect1>
<refsect1>
<title>Attributes</title>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<?dbhtml cellpadding="10"?>
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="3.5in"/>
<tbody>
<row valign="top">
<entry>"border_width"</entry>
<entry>Read</entry>
<entry>The width of the empty border outside the containers
children.</entry>
</row>
<row valign="top">
<entry>"resize_mode"</entry>
<entry>Read</entry>
<entry>Specify how resize events are handled. One of:
<literal>gtk.RESIZE_PARENT</literal>, <literal>gtk.RESIZE_QUEUE</literal> or
<literal>gtk.RESIZE_IMMEDIATE</literal></entry>
</row>
<row valign="top">
<entry>"focus_child"</entry>
<entry>Read</entry>
<entry>The child widget that has the focus</entry>
</row>
<row valign="top">
<entry>"need_resize"</entry>
<entry>Read</entry>
<entry>If True the container needs resizing</entry>
</row>
<row valign="top">
<entry>"reallocate_redraws"</entry>
<entry>Read</entry>
<entry>if True redraw the container when a child gets
reallocated</entry>
</row>
<row valign="top">
<entry>"has_focus_chain"</entry>
<entry>Read</entry>
<entry>If True the container had its focus chain explicitly
set</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="signal-prototypes-gtkcontainer">
<title>gtk.Container Signal Prototypes</title>
<para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
<variablelist>
<varlistentry>
<term>"<link linkend="signal-gtkcontainer--add">add</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>container</parameter>
</methodparam>
<methodparam><parameter>widget</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkcontainer--check-resize">check-resize</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>container</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkcontainer--remove">remove</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>container</parameter>
</methodparam>
<methodparam><parameter>widget</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkcontainer--set-focus-child">set-focus-child</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>container</parameter>
</methodparam>
<methodparam><parameter>widget</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
class provides common attributes and methods for a large number of widget
subclasses that manage the layout of other widgets within the area of a
window.</para>
<para>A <literal>PyGTK</literal> user interface is constructed by
nesting widgets inside widgets. Container widgets are the inner nodes in the
resulting tree of widgets: they contain other widgets. So, for example, you
might have a <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link>
containing a <link
linkend="class-gtkframe"><classname>gtk.Frame</classname></link> containing
a <link linkend="class-gtklabel"><classname>gtk.Label</classname></link>. If
you wanted an image instead of a textual label inside the frame, you might
replace the <link
linkend="class-gtklabel"><classname>gtk.Label</classname></link> widget with
a <link linkend="class-gtkimage"><classname>gtk.Image</classname></link>
widget.</para>
<para>There are two major kinds of container widgets. Both are
subclasses of the abstract <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
base class.</para>
<para>The first type of container widget has a single child widget and
derives from <link
linkend="class-gtkbin"><classname>gtk.Bin</classname></link>. These
containers are decorators, that add some kind of functionality to the
child. For example, a <link
linkend="class-gtkbutton"><classname>gtk.Button</classname></link> makes its
child into a clickable button; a <link
linkend="class-gtkframe"><classname>gtk.Frame</classname></link> draws a
frame around its child and a <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> places
its child widget inside a top-level window.</para>
<para>The second type of container can have more than one child; its
purpose is to manage layout. This means that these containers assign sizes
and positions to their children. For example, a <link
linkend="class-gtkhbox"><classname>gtk.HBox</classname></link> arranges its
children in a horizontal row, and a <link
linkend="class-gtktable"><classname>gtk.Table</classname></link> arranges
the widgets it contains in a two-dimensional grid.</para>
<para>To fulfill its task, a layout container must negotiate the size
requirements with its parent and its children. This negotiation is carried
out in two phases, size requisition and size allocation.</para>
<refsect2 id='sec-ContainerSizeRequisition'>
<title>Size Requisition</title>
<para>The size requisition of a widget is it's desired width and
height. This is represented by a <link
linkend="class-gtkrequisition"><classname>gtk.Requisition</classname></link>.</para>
<para>How a widget determines its desired size depends on the
widget. A <link
linkend="class-gtklabel"><classname>gtk.Label</classname></link>, for
example, requests enough space to display all its text. Container widgets
generally base their size request on the requisitions of their
children.</para>
<para>The size requisition phase of the widget layout process operates
top-down. It starts at a top-level widget, typically a GtkWindow. The
top-level widget asks its child for its size requisition by calling
gtk_widget_size_request(). To determine its requisition, the child asks its
own children for their requisitions and so on. Finally, the top-level widget
will get a requisition back from its child.</para>
</refsect2>
<refsect2 id="sec-ContainerSizeAllocation">
<title>Size Allocation</title>
<para>When the top-level widget has determined how much space its
child would like to have, the second phase of the size negotiation, size
allocation, begins. Depending on its configuration (see the <link
linkend="method-gtkwindow--set-resizable"><methodname>gtk.Window.set_resizable</methodname>()</link>
method), the top-level widget may be able to expand in order to satisfy the
size request or it may have to ignore the size request and keep its fixed
size. It then tells its child widget how much space it gets by calling the
<link
linkend="method-gtkwidget--size-allocate"><methodname>size_allocate</methodname>()</link>
method. The child widget divides the space among its children and tells each
child how much space it got, and so on. Under normal circumstances, a <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> will
always give its child the amount of space the child requested.</para>
<para>A child's size allocation is represented by a <link
linkend="class-gdkrectangle"><classname>gtk.gdk.Rectangle</classname></link>
that contains not only a width and height, but also a position (i.e. X and Y
coordinates), so that containers can tell their children not only how much
space is available, but also where they are positioned inside the space
available to the container.</para>
<para>Widgets are required to honor the size allocation they receive;
a size request is only a request, and widgets must be able to cope with any
size.</para>
</refsect2>
<refsect2 id="sec-ContainerChildProperties">
<title>Child Properties</title>
<para><link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
introduces child properties - these are object properties that are not
specific to either the container or the contained widget, but rather to
their relation. Typical examples of child properties are the "position" or
"pack-type" of a widget which is contained in a <link
linkend="class-gtkbox"><classname>gtk.Box</classname></link>.</para>
<para>Use the <link
linkend="method-gtkcontainer--install-child-property"><methodname>install_child_property</methodname>()</link>
method to install child properties for a container class and the <link
linkend="method-gtkcontainer--list-child-properties"><methodname>list_child_properties</methodname>()</link>
function to get information about existing child properties.</para>
<para>To set the value of a child property, use the <link
linkend="method-gtkcontainer--child-set-property"><methodname>child_set_property</methodname>()</link>,
or <link
linkend="method-gtkcontainer--child-set"><methodname>child_set</methodname>()</link>
methods. To obtain the value of a child property, use the <link
linkend="method-gtkcontainer--child-get-property"><methodname>child_get_property</methodname>()</link>,
or <link
linkend="method-gtkcontainer--child-get"><methodname>child_get</methodname>()</link>
methods. To emit notification about child property changes, use the <link
linkend="method-gtkwidget--child-notify"><methodname>gtk.Widget.child_notify</methodname>()</link>
method.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gtkcontainer--set-border-width">
<title>gtk.Container.set_border_width</title>
<programlisting><methodsynopsis language="python">
<methodname>set_border_width</methodname>
<methodparam><parameter
role="keyword">border_width</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">border_width</parameter> :</term>
<listitem><simpara>The amount of blank space to leave
<emphasis>outside</emphasis> the container. Valid values are in the range
0-65535 pixels.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_border_width</methodname>() method sets the
"border-width" property of the container. The border width of a container is
the amount of space to leave around the outside of the container. The only
exception to this is <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link>; because
toplevel windows can't leave space outside, they leave the space inside. The
border is added on all sides of the container.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-border-width">
<title>gtk.Container.get_border_width</title>
<programlisting><methodsynopsis language="python">
<methodname>get_border_width</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the current border width</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_border_width</methodname>() method retrieves
the value of the "border-width" property of the container. See <link
linkend="method-gtkcontainer--set-border-width"><methodname>set_border_width</methodname>()</link>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--add">
<title>gtk.Container.add</title>
<programlisting><methodsynopsis language="python">
<methodname>add</methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">widget</parameter> :</term>
<listitem><simpara>a widget to be placed inside the
container</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>add</methodname>() method adds
<parameter>widget</parameter> to the container. This method is typically
used for simple containers such as <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link>, <link
linkend="class-gtkframe"><classname>gtk.Frame</classname></link>, or <link
linkend="class-gtkbutton"><classname>gtk.Button</classname></link> that hold
a single child widget. For layout containers that handle multiple children
such as <link linkend="class-gtkbox"><classname>gtk.Box</classname></link>
or <link linkend="class-gtktable"><classname>gtk.Table</classname></link>,
this function will pick default packing parameters that may not be correct.
Containers that handle multiple children usually have additional methods
such as <link
linkend="method-gtkbox--pack-start"><methodname>gtk.Box.pack_start</methodname>()</link>
and <link
linkend="method-gtktable--attach"><methodname>gtk.Table.attach</methodname>()</link>
as an alternative to <methodname>add</methodname>(). Adding a widget to a
container usually results in the resizing and redrawing of the container
contents.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--remove">
<title>gtk.Container.remove</title>
<programlisting><methodsynopsis language="python">
<methodname>remove</methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">widget</parameter> :</term>
<listitem><simpara>a current child of
<parameter>container</parameter></simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>remove</methodname>() method removes
<parameter>widget</parameter> from the container.
<parameter>widget</parameter> must be inside the container. Note that the
container will own a reference to <parameter>widget</parameter>, and that
this may be the last reference held; so removing a widget from its container
can cause that widget to be destroyed. If you want to use
<parameter>widget</parameter> again, you should add a reference to
it.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-resize-mode">
<title>gtk.Container.set_resize_mode</title>
<programlisting><methodsynopsis language="python">
<methodname>set_resize_mode</methodname>
<methodparam><parameter
role="keyword">resize_mode</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">resize_mode</parameter> :</term>
<listitem><simpara>the new resize mode.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set-resize_mode</methodname>() method sets the
"resize=mode" property of the container. The resize mode of a container
determines whether a resize request will be passed to the container's parent
(<literal>gtk.RESIZE_PARENT</literal>), queued for later execution
(<literal>gtk.RESIZE_QUEUE</literal>) or executed immediately
(<literal>gtk.RESIZE_IMMEDIATE</literal>).</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-resize-mode">
<title>gtk.Container.get_resize_mode</title>
<programlisting><methodsynopsis language="python">
<methodname>get_resize_mode</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the current resize mode</simpara></listitem>
</varlistentry>
</variablelist>
<para>The get_resize_mode() method returns the value of the
"resize-mode" property for of the container. See <link
linkend="method-gtkcontainer--set-resize-mode"><methodname>set_resize_mode()</methodname></link>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--check-resize">
<title>gtk.Container.check_resize</title>
<programlisting><methodsynopsis language="python">
<methodname>check_resize</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<para>The <methodname>check_resize</methodname>() method emits the
"check-resize" signal on the container.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--forall">
<title>gtk.Container.forall</title>
<programlisting><methodsynopsis language="python">
<methodname>forall</methodname>
<methodparam><parameter
role="keyword">callback</parameter></methodparam>
<methodparam><parameter
role="keyword">callback_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">callback</parameter> :</term>
<listitem><simpara>a callback</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter
role="keyword">callback_data</parameter> :</term>
<listitem><simpara>the callback user data</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>forall</methodname>() method arranges to invoke
<parameter>callback</parameter> on each child of the container including
children that are considered "internal" (implementation details of the
container). "Internal" children generally weren't added by the user of the
container, but were added by the container implementation itself. Most
applications should use the <link
linkend="method-gtkcontainer--foreach"><methodname>foreach</methodname>()</link>
method, rather than the <methodname>forall</methodname>() method.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--foreach">
<title>gtk.Container.foreach</title>
<programlisting><methodsynopsis language="python">
<methodname>foreach</methodname>
<methodparam><parameter
role="keyword">callback</parameter></methodparam>
<methodparam><parameter
role="keyword">callback_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">callback</parameter> :</term>
<listitem><simpara>a callback</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter
role="keyword">callback_data</parameter> :</term>
<listitem><simpara>the callback user data</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>foreach</methodname>() method arranges to invoke
<parameter>callback</parameter> on each non-internal child of the
container.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-children">
<title>gtk.Container.get_children</title>
<programlisting><methodsynopsis language="python">
<methodname>get_children</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a list of the container's non-internal
children.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_children</methodname>() method returns
the container's non-internal children.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--propagate-expose">
<title>gtk.Container.propagate_expose</title>
<programlisting><methodsynopsis language="python">
<methodname>propagate_expose</methodname>
<methodparam><parameter
role="keyword">child</parameter></methodparam>
<methodparam><parameter
role="keyword">event</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">child</parameter> :</term>
<listitem><simpara>a child of the container</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">event</parameter> :</term>
<listitem><simpara>a expose event sent to the
container</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>propagate_expose</methodname>() method sends
synthetic expose events to all children that don't have their own <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>s when
the container receives an expose event.</para>
<para>The <link
linkend="method-gtkcontainer--propagate-expose"><methodname>propagate_expose</methodname>()</link>
takes care of deciding whether an expose event needs to be sent to the
child, intersecting the event's area with the child area, and sending the
event.</para>
<para>In most cases, a container can simply either simply inherit the
expose implementation from <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>,
or, do some drawing and then chain to the expose implementation from <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-focus-chain">
<title>gtk.Container.set_focus_chain</title>
<programlisting><methodsynopsis language="python">
<methodname>set_focus_chain</methodname>
<methodparam><parameter
role="keyword">focusable_widgets</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">focusable_widgets</parameter> :</term>
<listitem><simpara>a list or tuple containing a chain of focusable
widgets.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_focus_chain</methodname>() method sets a
focus chain, overriding the one computed automatically by GTK. In principle
each widget in the chain should be a descendant of the container, but this
is not enforced by this method, since it's allowed to set the focus chain
before you pack the widgets, or have a widget in the chain that isn't always
packed. The necessary checks are done when the focus chain is actually
traversed.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-focus-chain">
<title>gtk.Container.get_focus_chain</title>
<programlisting><methodsynopsis language="python">
<methodname>get_focus_chain</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a list containing the widgets in the focus
chain if the focus chain of the container has been set explicitly or None if
no focus chain has been explicitly set.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_focus_chain</methodname>() method retrieves
the focus chain of the container, if one has been set explicitly. If no
focus chain has been explicitly set, GTK computes the focus chain based on
the positions of the children. In that case, the method returns None.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--unset-focus-chain">
<title>gtk.Container.unset_focus_chain</title>
<programlisting><methodsynopsis language="python">
<methodname>unset_focus_chain</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<para>The <methodname>unset_focus_chain</methodname>() method removes
a focus chain explicitly set with <link
linkend="method-gtkcontainer--set-focus-chain"><methodname>set_focus_chain</methodname>()</link>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-reallocate-redraws">
<title>gtk.Container.set_reallocate_redraws</title>
<programlisting><methodsynopsis language="python">
<methodname>set_reallocate_redraws</methodname>
<methodparam><parameter
role="keyword">needs_redraws</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">needs_redraws</parameter> :</term>
<listitem><simpara>the new value for the container's
reallocate_redraws attribute.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_reallocate_redraws</methodname>() method
sets the reallocate_redraws attribute of the container to the value of
<parameter>needs_redraws</parameter>. Containers requesting reallocation
redraws get automatically redrawn if any of their children change
allocation.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-focus-child">
<title>gtk.Container.set_focus_child</title>
<programlisting><methodsynopsis language="python">
<methodname>set_focus_child</methodname>
<methodparam><parameter
role="keyword">child</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">child</parameter> :</term>
<listitem><simpara>the child widget that will get the
focus.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_focus_child</methodname>() method emits the
"set-focus-child" signal that arranges for the child widget referenced by
<parameter>child</parameter> to get the focus and recalculates the container
adjustments.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-focus-child">
<title>gtk.Container.get_focus_child</title>
<programlisting><methodsynopsis language="python">
<methodname>get_focus_child</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>The child widget which has the focus inside container,
or <literal>None</literal> if none is set.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.14 and above.</para>
</note>
<para>The <methodname>get_focus_child</methodname>() method returns the
current focus child widget inside container.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-focus-vadjustment">
<title>gtk.Container.set_focus_vadjustment</title>
<programlisting><methodsynopsis language="python">
<methodname>set_focus_vadjustment</methodname>
<methodparam><parameter
role="keyword">adjustment</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">adjustment</parameter> :</term>
<listitem><simpara>The new vertical focus
adjustment</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_focus_vadjustment</methodname>() method sets
the vertical focus adjustment to the value of
<parameter>adjustment</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-focus-vadjustment">
<title>gtk.Container.get_focus_vadjustment</title>
<programlisting><methodsynopsis language="python">
<methodname>get_focus_vadjustment</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the vertical focus adjustment, or
<literal>None</literal> if none has been set.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The get_focus_vadjustment() method retrieves the vertical focus
adjustment for the container. See the <link
linkend="method-gtkcontainer--set-focus-vadjustment"><methodname>set_focus_vadjustment</methodname>()</link>
method.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--set-focus-hadjustment">
<title>gtk.Container.set_focus_hadjustment</title>
<programlisting><methodsynopsis language="python">
<methodname>set_focus_hadjustment</methodname>
<methodparam><parameter
role="keyword">adjustment</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">adjustment</parameter> :</term>
<listitem><simpara>The new horizontal focus
adjustment</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_focus_hadjustment</methodname>() method sets
the horizontal focus adjustment to the value of
<parameter>adjustment</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--get-focus-hadjustment">
<title>gtk.Container.get_focus_hadjustment</title>
<programlisting><methodsynopsis language="python">
<methodname>get_focus_hadjustment</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the horizontal focus adjustment, or
<literal>None</literal> if none has been set.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_focus_hadjustment</methodname>() method
retrieves the horizontal focus adjustment for the container. See <link
linkend="method-gtkcontainer--set-focus-hadjustment"><methodname>set_focus_hadjustment</methodname>()</link>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--resize-children">
<title>gtk.Container.resize_children</title>
<programlisting><methodsynopsis language="python">
<methodname>resize_children</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<para>The <methodname>resize_children</methodname>() method causes the
container to recalculate its size and its children's sizes.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--child-type">
<title>gtk.Container.child_type</title>
<programlisting><methodsynopsis language="python">
<methodname>child_type</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a type.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>child_type</methodname>() method returns the
type of the children that can be added to the container. Note that this may
return a void type to indicate that no more children can be added, e.g. for
a <link linkend="class-gtkpaned"><classname>gtk.Paned</classname></link>
which already has two children or a <link
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> that
already has a child.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--add-with-properties">
<title>gtk.Container.add_with_properties</title>
<programlisting><methodsynopsis language="python">
<methodname>add_with_properties</methodname>
<methodparam><parameter>widget</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>first_prop_value</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>widget</parameter> :</term>
<listitem><simpara>a widget to be added</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>first_prop_name</parameter> :</term>
<listitem><simpara>the first property name</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>first_prop_value</parameter> :</term>
<listitem><simpara>a value for the first
property</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional property name and value
pairs</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>add_with_properties</methodname>() method adds
the child widget specified by <parameter>widget</parameter> to the container
while allowing the setting of zero or more container child property values
at the same time. Containers supporting add with settable child properties
are: <link linkend="class-gtkbox"><classname>gtk.Box</classname></link>,
<link linkend="class-gtkfixed"><classname>gtk.Fixed</classname></link>,
<link linkend="class-gtknotebook"><classname>gtk.Notebook</classname></link>
and <link
linkend="class-gtktable"><classname>gtk.Table</classname></link>.</para>
<para>For example the following adds a button to a <link
linkend="class-gtkfixed"><classname>gtk.Fixed</classname></link> layout
widget and sets the child properties "x" and "y" specifying the child
position in the layout:</para>
<programlisting>
fixed.add_with_properties(button, "x", 10, "y", 20")
</programlisting>
</refsect2>
<refsect2 id="method-gtkcontainer--child-set">
<title>gtk.Container.child_set</title>
<programlisting><methodsynopsis language="python">
<methodname>child_set</methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>child</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>first_prop_name</parameter> :</term>
<listitem><simpara>the first property name</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>first_prop_value</parameter> :</term>
<listitem><simpara>the value of the first
property</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional property name and value
pairs</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>child_set</methodname>() method sets the
properties for <parameter>child</parameter> using the given property name
and value pairs.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--child-get">
<title>gtk.Container.child_get</title>
<programlisting><methodsynopsis language="python">
<methodname>child_get</methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>first_prop_name</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>child</parameter> :</term>
<listitem><simpara>the child widget to get the child properties
for</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>first_prop_name</parameter> :</term>
<listitem><simpara>the first property name</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional property names</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a tuple containing the property values
requested</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>child_get</methodname>() method retrieves the
requested container child properties for
<parameter>child</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--child-set-property">
<title>gtk.Container.child_set_property</title>
<programlisting><methodsynopsis language="python">
<methodname>child_set_property</methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>property_name</parameter></methodparam>
<methodparam><parameter>value</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>child</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>property_name</parameter> :</term>
<listitem><simpara>the child property name</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter> :</term>
<listitem><simpara>a value to associate with the
property</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>child_set_property</methodname>() method sets
the property name specified by <parameter>property_name</parameter> with the
value specified in <parameter>value</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkcontainer--child-get-property">
<title>gtk.Container.child_get_property</title>
<programlisting><methodsynopsis language="python">
<methodname>child_get_property</methodname>
<methodparam><parameter>child</parameter></methodparam>
<methodparam><parameter>property_name</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>child</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>property_name</parameter> :</term>
<listitem><simpara>the child property name</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the value of the child property for the
widget</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>child_get_property</methodname>() method
retrieves the value of the child property specified by
<parameter>property_name</parameter> for the widget
<parameter>child</parameter>.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Class Methods</title>
<refsect2 id="method-gtkcontainer--install-child-property">
<title>gtk.Container.install_child_property</title>
<programlisting><methodsynopsis language="python">
<methodname>install_child_property</methodname>
<methodparam><parameter role="keyword">property_id</parameter></methodparam>
<methodparam><parameter role="keyword">pspec</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">property_id</parameter> :</term>
<listitem><simpara>an integer property ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">pspec</parameter> :</term>
<listitem><simpara>a tuple containing a parameter
specifications</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.10 and above.</para>
</note>
<para>The <methodname>install_child_property</methodname>() method
installs a child property for the container class using the integer ID
specified by
<parameter>property_id</parameter>. <parameter>pspec</parameter> is a
tuple containing at least 5 items. The first 4 items contain the
following parameter specification items:</para>
<itemizedlist>
<listitem>
<simpara>a string specifying the name of the property</simpara>
</listitem>
<listitem>
<simpara>an object specifying the property type</simpara>
</listitem>
<listitem>
<simpara>a string specifying the nickname for the property or
<literal>None</literal></simpara>
</listitem>
<listitem>
<simpara>a string specifying the short description for the property
or <literal>None</literal></simpara>
</listitem>
</itemizedlist>
<para>The last item must be a integer containing a combination of the
<link linkend="gobject-param-constants">GObject Param Flag
Constants</link>. Additional tuple items (if needed) are inserted
between the fourth item and the last item depending on the property
type:</para>
<variablelist>
<varlistentry>
<term><literal>gobject.TYPE_CHAR</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_CHAR</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_BOOLEAN</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_INT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_UINT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_LONG</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_ULONG</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_INT64</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_UINT64</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_ENUM</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_FLAGS</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_FLOAT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_DOUBLE</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_STRING</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_PARAM</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_BOXED</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_POINTER</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_OBJECT</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="method-gtkcontainer--list-child-properties">
<title>gtk.Container.list_child_properties</title>
<programlisting><methodsynopsis language="python">
<methodname>list_child_properties</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the list of child properties</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.10 and above.</para>
</note>
<para>The <methodname>list_child_properties</methodname>() method
returns a list containing the child properties of the container
class. See the <link
linkend="method-gtkcontainer--install-child-property"><methodname>install_child_property</methodname>()</link>
method for more information.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Functions</title>
<refsect2 id="function-gtk--container-class-install-child-property">
<title>gtk.container_class_install_child_property</title>
<programlisting><methodsynopsis language="python">
<methodname>gtk.container_class_install_child_property</methodname>
<methodparam><parameter
role="keyword">klass</parameter></methodparam>
<methodparam><parameter role="keyword">property_id</parameter></methodparam>
<methodparam><parameter role="keyword">pspec</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">klass</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
class or instance.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">property_id</parameter> :</term>
<listitem><simpara>an integer property ID</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">pspec</parameter> :</term>
<listitem><simpara>a tuple containing a parameter
specification</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This function is available in PyGTK 2.4 and above.</para>
</note>
<warning>
<para>This function is deprecated in PyGTK 2.10 and above.</para>
</warning>
<para>The
<function>gtk.container_class_install_child_property</function>()
function installs a child property for the container class specified
by <parameter>klass</parameter> using the integer ID specified by
<parameter>property_id</parameter>. <parameter>pspec</parameter> is a
tuple containing at least 5 items. The first 4 items contain the
following parameter specification items:</para>
<itemizedlist>
<listitem>
<simpara>a string specifying the name of the property</simpara>
</listitem>
<listitem>
<simpara>an object specifying the property type</simpara>
</listitem>
<listitem>
<simpara>a string specifying the nickname for the property or
<literal>None</literal></simpara>
</listitem>
<listitem>
<simpara>a string specifying the short description for the property
or <literal>None</literal></simpara>
</listitem>
</itemizedlist>
<para>The last item must be a integer containing a combination of the
<link linkend="gobject-param-constants">GObject Param Flag
Constants</link>. Additional tuple items (if needed) are inserted
between the fourth item and the last item depending on the property
type:</para>
<variablelist>
<varlistentry>
<term><literal>gobject.TYPE_CHAR</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_CHAR</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_BOOLEAN</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_INT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_UINT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_LONG</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_ULONG</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_INT64</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_UINT64</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_ENUM</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_FLAGS</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_FLOAT</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_DOUBLE</literal></term>
<listitem>
<simpara>minimum, maximum and default values</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_STRING</literal></term>
<listitem>
<simpara>default value</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_PARAM</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_BOXED</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_POINTER</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gobject.TYPE_OBJECT</literal></term>
<listitem>
<simpara>Not applicable</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2 id="function-gtk--container-class-list-child-properties">
<title>gtk.container_class_list_child_properties</title>
<programlisting><methodsynopsis language="python">
<methodname>gtk.container_class_list_child_properties</methodname>
<methodparam><parameter
role="keyword">klass</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">klass</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gtkcontainer"><classname>gtk.Container</classname></link>
class or instance.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a tuple containing the list of child properties</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This function is available in PyGTK 2.4 and above.</para>
</note>
<warning>
<para>This function is deprecated in PyGTK 2.10 and above.</para>
</warning>
<para>The
<function>gtk.container_class_list_child_properties</function>()
function returns a tuple containing the child properties of the
container class specified by <parameter>klass</parameter>.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Signals</title>
<refsect2 id="signal-gtkcontainer--add">
<title>The "add" gtk.Container Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>container</parameter></methodparam>
<methodparam><parameter>widget</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>container</parameter> :</term>
<listitem><simpara>the container that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>widget</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "add" signal is emitted when <parameter>widget</parameter>
is added to the <parameter>container</parameter>.</para>
</refsect2>
<refsect2 id="signal-gtkcontainer--check-resize">
<title>The "check-resize" gtk.Container Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>container</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>container</parameter> :</term>
<listitem><simpara>the container that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "check-resize" signal is emitted when the
<methodname>check_resize</methodname>() method is called forcing the
recalculation of the container and its children. See the <link
linkend="method-gtkcontainer--set-resize-mode"><methodname>set_resize_mode</methodname>()</link>
method for details.</para>
</refsect2>
<refsect2 id="signal-gtkcontainer--remove">
<title>The "remove" gtk.Container Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>container</parameter></methodparam>
<methodparam><parameter>widget</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>container</parameter> :</term>
<listitem><simpara>the container that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>widget</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "remove" signal is emitted when
<parameter>widget</parameter> is removed from
<parameter>container</parameter>.</para>
</refsect2>
<refsect2 id="signal-gtkcontainer--set-focus-child">
<title>The "set-focus-child" gtk.Container Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>container</parameter></methodparam>
<methodparam><parameter>widget</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>container</parameter> :</term>
<listitem><simpara>the container that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>widget</parameter> :</term>
<listitem><simpara>the child widget</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "set-focus-child" signal is emitted when the <link
linkend="method-gtkcontainer--set-focus-child"><methodname>set_focus_child</methodname>()</link>
method is called. <parameter>widget</parameter> is set as the child in
<parameter>container</parameter> with the focus.</para>
</refsect2>
</refsect1>
</refentry>
|