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
|
# Python bindings for the GtkExtra widget set
#
# Copyright (C) 2000-2001 Andreas Voegele
#
# The documentation is based on the GtkAda documentation and used by
# permission. GtkAda is available at http://gtkada.eu.org/ and
# copyrighted by Emmanuel Briot, Joel Brobecker and Arnaud Charlet.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
import gtk; _gtk = gtk; del gtk
import _gtkextra
import types
# sheet state
SHEET_NORMAL = 0
SHEET_ROW_SELECTED = 1
SHEET_COLUMN_SELECTED = 2
SHEET_RANGE_SELECTED = 3
# sheet border mask
SHEET_LEFT_BORDER = 1 << 0
SHEET_RIGHT_BORDER = 1 << 1
SHEET_TOP_BORDER = 1 << 2
SHEET_BOTTOM_BORDER = 1 << 3
# sheet flags
SHEET_IS_LOCKED = 1 << 0
SHEET_IS_FROZEN = 1 << 1
SHEET_IN_XDRAG = 1 << 2
SHEET_IN_YDRAG = 1 << 3
SHEET_IN_DRAG = 1 << 4
SHEET_IN_SELECTION = 1 << 5
SHEET_IN_RESIZE = 1 << 6
SHEET_IN_CLIP = 1 << 7
SHEET_ROW_FROZEN = 1 << 8
SHEET_COLUMN_FROZEN = 1 << 9
SHEET_AUTO_RESIZE = 1 << 10
SHEET_CLIP_TEXT = 1 << 11
SHEET_ROW_TITLES_VISIBLE = 1 << 12
SHEET_COLUMN_TITLES_VISIBLE = 1 << 13
SHEET_AUTO_SCROLL = 1 << 14
SHEET_JUSTIFY_ENTRY = 1 << 15
# plot bar units
PLOT_BAR_POINTS = 0
PLOT_BAR_RELATIVE = 1
PLOT_BAR_ABSOLUTE = 2
# plot scale type
PLOT_SCALE_LINEAR = 0
PLOT_SCALE_LOG10 = 1
# plot symbol type
PLOT_SYMBOL_NONE = 0
PLOT_SYMBOL_SQUARE = 1
PLOT_SYMBOL_CIRCLE = 2
PLOT_SYMBOL_UP_TRIANGLE = 3
PLOT_SYMBOL_DOWN_TRIANGLE = 4
PLOT_SYMBOL_RIGHT_TRIANGLE = 5
PLOT_SYMBOL_LEFT_TRIANGLE = 6
PLOT_SYMBOL_DIAMOND = 7
PLOT_SYMBOL_PLUS = 8
PLOT_SYMBOL_CROSS = 9
PLOT_SYMBOL_STAR = 10
PLOT_SYMBOL_DOT = 11
PLOT_SYMBOL_IMPULSE = 12
# plot symbol style
PLOT_SYMBOL_EMPTY = 0
PLOT_SYMBOL_FILLED = 1
PLOT_SYMBOL_OPAQUE = 2
# plot border style
PLOT_BORDER_NONE = 0
PLOT_BORDER_LINE = 1
PLOT_BORDER_SHADOW = 2
# plot line style
PLOT_LINE_NONE = 0
PLOT_LINE_SOLID = 1
PLOT_LINE_DOTTED = 2
PLOT_LINE_DASHED = 3
PLOT_LINE_DOT_DASH = 4
PLOT_LINE_DOT_DOT_DASH = 5
PLOT_LINE_DOT_DASH_DASH = 6
# plot connector
PLOT_CONNECT_NONE = 0
PLOT_CONNECT_STRAIGHT = 1
PLOT_CONNECT_SPLINE = 2
PLOT_CONNECT_HV_STEP = 3
PLOT_CONNECT_VH_STEP = 4
PLOT_CONNECT_MIDDLE_STEP = 5
# plot label mask
PLOT_LABEL_NONE = 0
PLOT_LABEL_IN = 1 << 0
PLOT_LABEL_OUT = 1 << 1
# plot orientation
PLOT_AXIS_X = 0
PLOT_AXIS_Y = 1
PLOT_AXIS_Z = 2
# plot axis
PLOT_AXIS_LEFT = 0
PLOT_AXIS_RIGHT = 1
PLOT_AXIS_TOP = 2
PLOT_AXIS_BOTTOM = 3
# plot label style
PLOT_LABEL_FLOAT = 0
PLOT_LABEL_EXP = 1
PLOT_LABEL_POW = 2
# plot ticks mask
PLOT_TICKS_NONE = 0
PLOT_TICKS_IN = 1 << 0
PLOT_TICKS_OUT = 1 << 1
# plot gradient mask
PLOT_GRADIENT_H = 1 << 0
PLOT_GRADIENT_V = 1 << 1
PLOT_GRADIENT_S = 1 << 2
# plot plane
PLOT_PLANE_XY = 0
PLOT_PLANE_YX = 0
PLOT_PLANE_XZ = 1
PLOT_PLANE_ZX = 1
PLOT_PLANE_YZ = 2
PLOT_PLANE_ZY = 2
# plot side
PLOT_SIDE_XY = 1 << 0
PLOT_SIDE_XZ = 1 << 1
PLOT_SIDE_YX = 1 << 2
PLOT_SIDE_YZ = 1 << 3
PLOT_SIDE_ZX = 1 << 4
PLOT_SIDE_ZY = 1 << 5
# plot paper size
PLOT_LETTER = 0
PLOT_LEGAL = 1
PLOT_A4 = 2
PLOT_EXECUTIVE = 3
# plot paper widths and heights
PLOT_LETTER_W = 612
PLOT_LETTER_H = 792
PLOT_LEGAL_W = 612
PLOT_LEGAL_H = 1008
PLOT_A4_W = 595
PLOT_A4_H = 842
PLOT_EXECUTIVE_W = 540
PLOT_EXECUTIVE_H = 720
# plot paper orientation
PLOT_PORTRAIT = 0
PLOT_LANDSCAPE = 1
# plot paper size unit
PLOT_PSPOINTS = 0
PLOT_MM = 1
PLOT_CM = 2
PLOT_INCHES = 3
# plot canvas flags
PLOT_CANVAS_CAN_SELECT = 1 << 0
PLOT_CANVAS_CAN_SELECT_ITEM = 1 << 1
PLOT_CANVAS_CAN_SELECT_POINT = 1 << 2
PLOT_CANVAS_CAN_DND = 1 << 3
PLOT_CANVAS_CAN_DND_POINT = 1 << 4
PLOT_CANVAS_DND_FLAGS = (PLOT_CANVAS_CAN_SELECT_ITEM
| PLOT_CANVAS_CAN_SELECT_POINT
| PLOT_CANVAS_CAN_DND
| PLOT_CANVAS_CAN_DND_POINT)
# plot canvas child flags
PLOT_CANVAS_FROZEN = 0
PLOT_CANVAS_CAN_MOVE = 1 << 0
PLOT_CANVAS_CAN_X_RESIZE = 1 << 1
PLOT_CANVAS_CAN_Y_RESIZE = 1 << 2
# plot canvas arrow flags
PLOT_ARROW_NONE = 0
PLOT_ARROW_ORIGIN = 1 << 0
PLOT_ARROW_END = 1 << 1
# plot canvas item type
PLOT_CANVAS_NONE = 0
PLOT_CANVAS_PLOT = 1
PLOT_CANVAS_AXIS = 2
PLOT_CANVAS_LEGENDS = 3
PLOT_CANVAS_TITLE = 4
PLOT_CANVAS_TEXT = 5
PLOT_CANVAS_DATA = 6
PLOT_CANVAS_LINE = 7
PLOT_CANVAS_RECTANGLE = 8
PLOT_CANVAS_ELLIPSE = 9
PLOT_CANVAS_PIXMAP = 10
PLOT_CANVAS_CUSTOM = 11
# icon list mode
ICON_LIST_ICON = 0
ICON_LIST_TEXT_RIGHT = 1
ICON_LIST_TEXT_BELOW = 2
class GtkSheet(_gtk.GtkContainer):
"""A GtkSheet is a table like the one you can find in most
spreadsheets. Each cell can contain some text or a widget.
"""
get_type = _gtkextra.gtk_sheet_get_type
"""Return the internal value associated with a GtkSheet."""
###############################
## Creation and modification ##
###############################
def __init__(self, rows=1, columns=1, title=None, entry_type=None,
editable=1, _obj=None):
"""Create a new sheet with a specific number of rows and
columns. You can fully specify which type the entry used to
modify the value of cells should have. The value of
entry_type can be found by using the get_type method of a
GtkWidget. The title is internal, and does not appear on the
screen. If editable is set to FALSE the sheet is read-only.
"""
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_sheet_new(rows, columns, title,
entry_type, editable)
def connect(self, name, f, *extra):
signals = {
'traverse': _gtkextra._gtk_sheet_callback_wrapper,
}
if signals.has_key(name):
extra = extra + (f,)
f = signals[name]
return apply(_gtk.GtkContainer.connect,
(self, name, f) + extra)
def set_hadjustment(self, adjustment):
"""Change the horizontal adjustment.
It indicates what range of columns is visible.
"""
_gtkextra.gtk_sheet_set_hadjustment(self._o, adjustment._o)
def set_vadjustment(self, adjustment):
"""Change the vertical adjustment.
It indicates what range of rows is visible.
"""
_gtkextra.gtk_sheet_set_vadjustment(self._o, adjustment._o)
def get_vadjustment(self):
"""Return the adjustment used to indicate the range of visible
rows.
"""
adjustment = _gtkextra.gtk_sheet_get_vadjustment(self._o)
if adjustment:
adjustment = _gtk._obj2inst(adjustment)
return adjustment
def get_hadjustment(self):
"""Return the adjustment used to indicate the range of visible
columns.
"""
adjustment = _gtkextra.gtk_sheet_get_hadjustment(self._o)
if adjustment:
adjustment = _gtk._obj2inst(adjustment)
return adjustment
def change_entry(self, entry_type):
"""Change the type of widget used to interactively modify the
value of the cells.
"""
_gtkextra.gtk_sheet_change_entry(self._o, entry_type)
def get_entry(self):
"""Return the entry widget used to modify the contents of the
cells. The parent of the entry widget, eg a combo box, can
be found with get_ancestor().
"""
entry_widget = _gtkextra.gtk_sheet_get_entry(self._o)
if entry_widget:
entry_widget = _gtk._obj2inst(entry_widget)
return entry_widget
def set_title(self, title):
"""Change the title of the sheet."""
_gtkextra.gtk_sheet_set_title(self._o, title)
def freeze(self):
"""Freeze all visual updates of the sheet until you thaw it.
The update will occur in a more efficient way.
"""
_gtkextra.gtk_sheet_freeze(self._o)
def thaw(self):
"""Thaw the sheet so that visual updates occur again.
Note that you have to call thaw() as many times as you have
called freeze() to actually thaw the widget.
"""
_gtkextra.gtk_sheet_thaw(self._o)
def moveto(self, row, column, row_align, column_align):
"""Scroll the viewing area to row and column.
The row_align and column_align arguments represent the
location on the screen that the cell should appear at.
0.0, 0.0 is at the top-left of the screen, whereas 1.0, 1.0
is at the bottom-right corner. If row or column is negative,
there is no change.
"""
_gtkextra.gtk_sheet_moveto(self._o, row, column, row_align,
column_align)
############################
## Selection and Clipping ##
############################
def get_state(self):
"""Return the status of the sheet's selection.
The status can be SHEET_NORMAL, SHEET_ROW_SELECTED,
SHEET_COLUMN_SELECTED or SHEET_RANGE_SELECTED.
"""
return _gtkextra.gtk_sheet_get_state(self._o)
def get_range(self):
"""Return the selected range."""
return _gtkextra.gtk_sheet_get_range(self._o)
def get_visible_range(self):
"""Return the range visible on the screen."""
return _gtkextra.gtk_sheet_get_visible_range(self._o)
def set_selection_mode(self, mode):
"""Change the selection mode.
Valid selection modes are SELECTION_SINGLE
and SELECTION_BROWSE.
"""
_gtkextra.gtk_sheet_set_selection_mode(self._o, mode)
def select_column(self, column):
"""Replace the current selection with a specific column.
The selected range is highlighted.
"""
_gtkextra.gtk_sheet_select_column(self._o, column)
def select_row(self, row):
"""Replace the current selection with a specific row.
The selected range is highlighted.
"""
_gtkextra.gtk_sheet_select_row(self._o, row)
def select_range(self, range):
"""Select a new range of cells."""
_gtkextra.gtk_sheet_select_range(self._o, range)
def unselect_range(self):
"""Unselect the current selected range."""
_gtkextra.gtk_sheet_unselect_range(self._o)
def clip_range(self, range):
"""Create a new clip range.
That range is flashed on the screen.
"""
_gtkextra.gtk_sheet_clip_range(self._o, range)
def unclip_range(self):
"""Destroy the clip range."""
_gtkextra.gtk_sheet_unclip_range(self._o)
def set_active_cell(self, row, column):
"""Set active cell where the entry will be displayed.
Returns FALSE if the current cell can not be deactivated
or if the requested cell can't be activated.
"""
return _gtkextra.gtk_sheet_set_active_cell(self._o, row,
column)
def get_active_cell(self):
"""Return the coordinates of the active cell or None if no
cell is active. The active cell is the cell that the user is
currently editing.
"""
return _gtkextra.gtk_sheet_get_active_cell(self._o)
#############
## Columns ##
#############
def set_column_title(self, column, title):
"""Modify the title of a column.
The first column on the left has the number 0.
Note that this title does not appear on the screen, and can
only be used internally to find a specific column.
"""
_gtkextra.gtk_sheet_set_column_title(self._o, column, title)
def get_column_title(self, column):
"""Return the title of a specific column."""
return _gtkextra.gtk_sheet_get_column_title(self._o, column)
def set_column_titles_height(self, height):
"""Modify the height of the row in which the column titles
appear.
"""
_gtkextra.gtk_sheet_set_column_titles_height(self._o, height)
def column_button_add_label(self, column, label):
"""Modify the label of the button that appears at the top of
each column.
"""
_gtkextra.gtk_sheet_column_button_add_label(self._o, column,
label)
def column_button_justify(self, column, justification):
"""Modify the justification for the label in the column button.
"""
_gtkextra.gtk_sheet_column_button_justify(self._o, column,
justification)
def show_column_titles(self):
"""Show the row in which the column titles appear."""
_gtkextra.gtk_sheet_show_column_titles(self._o)
def hide_column_titles(self):
"""Hide the row in which the column titles appear."""
_gtkextra.gtk_sheet_hide_column_titles(self._o)
def columns_set_sensitivity(self, sensitive):
"""Modify the sensitivity of all the columns.
If sensitive is FALSE, the columns can not be resized
dynamically. This also modifies the sensitivity of the button
at the top of the columns.
"""
_gtkextra.gtk_sheet_columns_set_sensitivity(self._o, sensitive)
def column_set_sensitivity(self, column, sensitive):
"""Modify the sensitivity of a specific column and its title
button. If sensitive is FALSE, the column can not be
dynamically resized.
"""
_gtkextra.gtk_sheet_column_set_sensitivity(self._o, column,
sensitive)
def column_set_visibility(self, column, visible):
"""Change the visibility of a column."""
_gtkextra.gtk_sheet_column_set_visibility(self._o, column,
visible)
def column_label_set_visibility(self, column, visible):
"""Change the visibility of the label in a given column."""
_gtkextra.gtk_sheet_column_label_set_visibility(self._o,
column,
visible)
def columns_labels_set_visibility(self, visible):
"""Change the visibility for all the column labels."""
_gtkextra.gtk_sheet_columns_labels_set_visibility(self._o,
visible)
def set_column_width(self, column, width):
"""Modify the width in pixels of a specific column."""
_gtkextra.gtk_sheet_set_column_width(self._o, column, width)
def get_column_width(self, column):
"""Return the width in pixels of the sheet's n-th column."""
return _gtkextra.gtk_sheet_get_column_width(self._o, column)
def add_column(self, n):
"""Add n empty columns at the end of the sheet."""
_gtkextra.gtk_sheet_add_column(self._o, n)
def insert_columns(self, column, n):
"""Add n empty columns just before column."""
_gtkextra.gtk_sheet_insert_columns(self._o, column, n)
def delete_columns(self, column, n):
"""Delete n columns starting with column."""
_gtkextra.gtk_sheet_delete_columns(self._o, column, n)
def column_set_justification(self, column, justification):
"""Set the default justification for the cells in the specific
column.
"""
_gtkextra.gtk_sheet_column_set_justification(self._o, column,
justification)
def get_columns_count(self):
"""Return the number of columns."""
return _gtkextra.gtk_sheet_get_columns_count(self._o)
##########
## Rows ##
##########
def set_row_title(self, row, title):
"""Modify the title of a row.
The first row at the top has the number 0.
Note that this title does not appear on the screen, and can
only be used internally to find a specific row.
"""
_gtkextra.gtk_sheet_set_row_title(self._o, row, title)
def get_row_title(self, row):
"""Return the title of a specific row."""
return _gtkextra.gtk_sheet_get_row_title(self._o, row)
def set_row_titles_width(self, width):
"""Modify the width of the column that has the row titles."""
_gtkextra.gtk_sheet_set_row_titles_width(self._o, width)
def row_button_add_label(self, row, label):
""" Modify the label of the button that appears at the left of
each row.
"""
_gtkextra.gtk_sheet_row_button_add_label(self._o, row, label)
def row_button_justify(self, row, justification):
"""Modify the justification for the label of the row button."""
_gtkextra.gtk_sheet_row_button_justify(self._o, row,
justification)
def show_row_titles(self):
"""Show the column in which the row titles appear."""
_gtkextra.gtk_sheet_show_row_titles(self._o)
def hide_row_titles(self):
"""Hide the column in which the row titles appear."""
_gtkextra.gtk_sheet_hide_row_titles(self._o)
def rows_set_sensitivity(self, sensitive):
"""Modify the sensitivity of all the rows.
If sensitive is FALSE, the rows can not be resized dynamically.
This also modifies the sensitivity of the button at the left
of the row.
"""
_gtkextra.gtk_sheet_rows_set_sensitivity(self._o, sensitive)
def row_set_sensitivity(self, row, sensitive):
"""Modify the sensitivity of a specific row and its title
button. If sensitive is FALSE, the row can not be
dynamically resized.
"""
_gtkextra.gtk_sheet_row_set_sensitivity(self._o, row,
sensitive)
def row_set_visibility(self, row, visible):
"""Modify the visibility of a specific row."""
_gtkextra.gtk_sheet_row_set_visibility(self._o, row, visible)
def row_label_set_visibility(self, row, visible):
"""Change the visibility of the label in a given row."""
_gtkextra.gtk_sheet_row_label_set_visibility(self._o, row,
visible)
def rows_labels_set_visibility(self, visible):
"""Change the visibility for all the row labels."""
_gtkextra.gtk_sheet_rows_labels_set_visibility(self._o,
visible)
def set_row_height(self, row, height):
"""Set the height in pixels of a specific row."""
_gtkextra.gtk_sheet_set_row_height(self._o, row, height)
def get_row_height(self, row):
"""Return the height in pixels of the sheet's n-th row."""
return _gtkextra.gtk_sheet_get_row_height(self._o, row)
def add_row(self, n):
"""Append n rows at the end of the sheet."""
_gtkextra.gtk_sheet_add_row(self._o, n)
def insert_rows(self, row, n):
"""Add n empty rows just before row."""
_gtkextra.gtk_sheet_insert_rows(self._o, row, n)
def delete_rows(self, row, n):
"""Delete n rows starting with row."""
_gtkextra.gtk_sheet_delete_rows(self._o, row, n)
def get_rows_count(self):
"""Return the number of rows."""
return _gtkextra.gtk_sheet_get_rows_count(self._o)
###########
## Range ##
###########
def range_clear(self, range):
"""Clear the content of the range."""
_gtkextra.gtk_sheet_range_clear(self._o, range)
def range_delete(self, range):
"""Clear the content of the range and delete all the links
(user data).
"""
_gtkextra.gtk_sheet_range_delete(self._o, range)
def range_set_background(self, range, color):
"""Set the background color for the cells in a specific range.
"""
_gtkextra.gtk_sheet_range_set_background(self._o, range, color)
def range_set_foreground(self, range, color):
"""Set the foreground color for the cells in a specific range.
"""
_gtkextra.gtk_sheet_range_set_foreground(self._o, range, color)
def range_set_justification(self, range, justification):
"""Set the text justification for the cells in the range."""
_gtkextra.gtk_sheet_range_set_justification(self._o, range,
justification)
def range_set_editable(self, range, editable):
"""Set whether the cells in the range are editable."""
_gtkextra.gtk_sheet_range_set_editable(self._o, range,
editable)
def range_set_visible(self, range, visible):
"""Set whether the cells in the range are visible."""
_gtkextra.gtk_sheet_range_set_visible(self._o, range, visible)
def range_set_border(self, range, mask, width, line_style=0):
"""Set the border style for the cells in the range."""
_gtkextra.gtk_sheet_range_set_border(self._o, range, mask,
width, line_style)
def range_set_border_color(self, range, color):
"""Change the color for the borders of the cells in the range.
"""
_gtkextra.gtk_sheet_range_set_border_color(self._o, range,
color)
def range_set_font(self, range, font):
"""Change the font of the cells in the range. The program has
to keep a reference to the GdkFont object."""
_gtkextra.gtk_sheet_range_set_font(self._o, range, font)
###########
## Cells ##
###########
def set_cell(self, row, column, justification, string):
"""Set the cell contents. Use the empty string to delete the
content of the cell.
"""
_gtkextra.gtk_sheet_set_cell(self._o, row, column,
justification, string)
def set_cell_text(self, row, column, string):
"""Set the cell contents. The justification used is the
previous one used in that cell."""
_gtkextra.gtk_sheet_set_cell_text(self._o, row, column, string)
def cell_get_text(self, row, column):
"""Return the text put in a specific cell. The empty string
is returned if there is no text in that cell."""
return _gtkextra.gtk_sheet_cell_get_text(self._o, row, column)
def cell_clear(self, row, column):
"""Clear the contents of the cell."""
_gtkextra.gtk_sheet_cell_clear(self._o, row, column)
def cell_delete(self, row, column):
"""Clear the contents of the cell and remove the user data
associated with it.
"""
_gtkextra.gtk_sheet_cell_delete(self._o, row, column)
def cell_get_state(self, row, column):
"""Return the state of the cell (normal or selected)."""
return _gtkextra.gtk_sheet_cell_get_state(self._o, row, column)
def get_pixel_info(self, x, y):
"""Return the row and column matching a given pixel on the
screen in a 2-tuple. Returns None if no such cell exists.
"""
return _gtkextra.gtk_sheet_get_pixel_info(self._o, x, y)
def get_cell_area(self, row, column):
"""Get the area of the screen that a cell is mapped to.
Returns a 4-tuple of the form (x, y, width, height).
"""
return _gtkextra.gtk_sheet_get_cell_area(self._o, row, column)
def get_attributes(self, row, column):
# TODO
return _gtkextra.gtk_sheet_get_attributes(self._o, row, column)
##############
## Children ##
##############
def put(self, widget, x, y):
"""Put a new child at a specific location (in pixels) in the
sheet."""
return _gtkextra.gtk_sheet_put(self._o, widget._o, x, y)
def attach(self, widget, row, column, x_align, y_align):
"""Attach a child to a specific cell in the sheet.
x_align and y_align should be between 0.0 and 1.0, indicating
that the child should be aligned from the left (resp. top) to
the right (resp. bottom) of the cell.
"""
_gtkextra.gtk_sheet_attach(self._o, widget._o, row, column,
x_align, y_align)
def move_child(self, widget, x, y):
"""Move a child of the table to a specific location in pixels.
A warning is printed if widget is not already a child of the
sheet.
"""
_gtkextra.gtk_sheet_move_child(self._o, widget._o, x, y)
def get_child_at(self, row, column):
"""Return the widget associated with the cell."""
return _gtkextra.gtk_sheet_get_child_at(self._o, row, column)
def button_attach(self, widget, row, column, x_align, y_align):
"""Attach a new button in the row or column title.
One of row or column must be negative (but only one).
This can be used to modify the standard buttons that appear at
the top of each column, or on the left of each row.
"""
_gtkextra.gtk_sheet_button_attach(self._o, widget._o, row,
column, x_align, y_align)
#######################
## Links / User Data ##
#######################
def link_cell(self, row, column, object):
"""Associate some user specific data with a given cell."""
_gtkextra.gtk_sheet_link_cell(self._o, row, column, object)
def get_link(self, row, column):
"""Return the user data associated with the cell.
None is returned if the cell has no user data.
"""
return _gtkextra.gtk_sheet_get_link(self._o, row, column)
def remove_link(self, row, column):
"""Delete the user data associated with the cell."""
_gtkextra.gtk_sheet_remove_link(self._o, row, column)
###########
## Flags ##
###########
def sheet_set_flags(self, flags):
_gtkextra.GTK_SHEET_SET_FLAGS(self._o, flags)
def sheet_unset_flags(self, flags):
_gtkextra.GTK_SHEET_UNSET_FLAGS(self._o, flags)
_gtk._name2cls['GtkSheet'] = GtkSheet
class GtkPlotData(_gtk.GtkWidget):
def __init__(self, function=None, _obj=None, *extra):
if _obj:
if function is not None:
extra = (_obj,) + extra
else:
self._o = _obj; return
self._o = _gtkextra.gtk_plot_data_new(function, extra)
def paint(self):
_gtkextra.gtk_plot_data_paint(self._o)
def draw_points(self, n):
_gtkextra.gtk_plot_data_draw_points(self._o, n)
def draw_symbol(self, x, y):
_gtkextra.gtk_plot_data_draw_symbol(self._o, x, y)
def set_points(self, x, y, dx=None, dy=None, n=-1):
_gtkextra.gtk_plot_data_set_points(self._o, x, y, dx, dy, n)
def get_points(self):
return _gtkextra.gtk_plot_data_get_points(self._o)
def set_numpoints(self, n):
_gtkextra.gtk_plot_data_set_numpoints(self._o, n)
def get_numpoints(self):
return _gtkextra.gtk_plot_data_get_numpoints(self._o)
def set_x(self, array):
_gtkextra.gtk_plot_data_set_x(self._o, array)
def get_x(self):
return _gtkextra.gtk_plot_data_get_x(self._o)
def set_y(self, array):
_gtkextra.gtk_plot_data_set_y(self._o, array)
def get_y(self):
return _gtkextra.gtk_plot_data_get_y(self._o)
def set_z(self, array):
_gtkextra.gtk_plot_data_set_z(self._o, array)
def get_z(self):
return _gtkextra.gtk_plot_data_get_z(self._o)
def set_a(self, array):
_gtkextra.gtk_plot_data_set_a(self._o, array)
def get_a(self):
return _gtkextra.gtk_plot_data_get_a(self._o)
def set_dx(self, array):
_gtkextra.gtk_plot_data_set_dx(self._o, array)
def get_dx(self):
return _gtkextra.gtk_plot_data_get_dx(self._o)
def set_dy(self, array):
_gtkextra.gtk_plot_data_set_dy(self._o, array)
def get_dy(self):
return _gtkextra.gtk_plot_data_get_dy(self._o)
def set_dz(self, array):
_gtkextra.gtk_plot_data_set_dz(self._o, array)
def get_dz(self):
return _gtkextra.gtk_plot_data_get_dz(self._o)
def set_da(self, array):
_gtkextra.gtk_plot_data_set_da(self._o, array)
def get_da(self):
return _gtkextra.gtk_plot_data_get_da(self._o)
def set_labels(self, labels):
_gtkextra.gtk_plot_data_set_da(self._o, labels)
def get_labels(self):
return _gtkextra.gtk_plot_data_get_labels(self._o)
def show_labels(self):
return _gtkextra.gtk_plot_data_get_labels(self._o)
def labels_set_attributes(self, fontname, height, angle, foreground,
background):
_gtkextra.gtk_plot_data_labels_set_attributes(self._o,
fontname, height,
angle,
foreground,
background)
def set_symbol(self, symbol_type, symbol_style, size, line_width,
color, border_color=None):
_gtkextra.gtk_plot_data_set_symbol(self._o, symbol_type,
symbol_style, size,
line_width, color,
border_color)
def get_symbol(self):
return _gtkextra.gtk_plot_data_get_symbol(self._o)
def set_connector(self, connector):
_gtkextra.gtk_plot_data_set_connector(self._o, connector)
def get_connector(self):
return _gtkextra.gtk_plot_data_get_connector(self._o)
def set_line_attributes(self, line_style, width, color):
_gtkextra.gtk_plot_data_set_line_attributes(self._o,
line_style,
width, color)
def get_line_attributes(self):
return _gtkextra.gtk_plot_data_get_line_attributes(self._o)
def set_x_attributes(self, line_style, width, color):
_gtkextra.gtk_plot_data_set_x_attributes(self._o, line_style,
width, color)
def set_y_attributes(self, line_style, width, color):
_gtkextra.gtk_plot_data_set_y_attributes(self._o, line_style,
width, color)
def set_z_attributes(self, line_style, width, color):
_gtkextra.gtk_plot_data_set_z_attributes(self._o, line_style,
width, color)
def show_xerrbars(self):
_gtkextra.gtk_plot_data_show_xerrbars(self._o)
def hide_xerrbars(self):
_gtkextra.gtk_plot_data_hide_xerrbars(self._o)
def show_yerrbars(self):
_gtkextra.gtk_plot_data_show_yerrbars(self._o)
def hide_yerrbars(self):
_gtkextra.gtk_plot_data_hide_yerrbars(self._o)
def show_zerrbars(self):
_gtkextra.gtk_plot_data_show_zerrbars(self._o)
def hide_zerrbars(self):
_gtkextra.gtk_plot_data_hide_zerrbars(self._o)
def fill_area(self, fill):
_gtkextra.gtk_plot_data_fill_area(self._o, fill)
def area_is_filled(self):
return _gtkextra.gtk_plot_data_area_is_filled(self._o)
def show_legend(self):
_gtkextra.gtk_plot_data_show_legend(self._o)
def hide_legend(self):
_gtkextra.gtk_plot_data_hide_legend(self._o)
def set_legend(self, string):
_gtkextra.gtk_plot_data_set_legend(self._o, string)
def set_name(self, name):
_gtkextra.gtk_plot_data_set_name(self._o, name)
def set_gradient_mask(self, mask):
"""Valid flags are PLOT_GRADIENT_H, PLOT_GRADIENT_V and
PLOT_GRADIENT_S.
"""
_gtkextra.gtk_plot_data_set_gradient_mask(self._o, mask)
def gradient_set_mask(self, mask):
"""Obsolete, use set_gradient_mask() instead."""
self.set_gradient_mask(mask)
def get_gradient_mask(self):
return _gtkextra.gtk_plot_data_get_gradient_mask(self._o)
def gradient_get_mask(self):
"""Obsolete, use get_gradient_mask() instead."""
return self.gradient_get_mask()
def gradient_set_visible(self, visible):
_gtkextra.gtk_plot_data_gradient_set_visible(self._o, visible)
def gradient_visible(self):
return _gtkextra.gtk_plot_data_gradient_visible(self._o)
def gradient_get_visible(self):
return self.gradient_visible()
def set_gradient_colors(self, min_color, max_color):
_gtkextra.gtk_plot_data_set_gradient_colors(self._o,
min_color,
max_color)
def get_gradient_colors(self):
return _gtkextra.gtk_plot_data_get_gradient_colors(self._o)
def set_gradient(self, min, max, levels):
_gtkextra.gtk_plot_data_set_gradient(self._o, min, max, levels)
def get_gradient(self):
return _gtkextra.gtk_plot_data_get_gradient(self._o)
def get_gradient_level(self, level):
return _gtkextra.gtk_plot_data_get_gradient_level(self._o,
level)
def set_link(self, object):
_gtkextra.gtk_plot_data_set_link(self._o, object);
def get_link(self):
return _gtkextra.gtk_plot_data_get_link(self._o);
def remove_link(self):
_gtkextra.gtk_plot_data_remove_link(self._o);
_gtk._name2cls['GtkPlotData'] = GtkPlotData
class GtkPlotBar(GtkPlotData):
get_type = _gtkextra.gtk_plot_bar_get_type
"""Return the internal value associated with a GtkPlotBar."""
def __init__(self, orientation=1, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_bar_new(orientation)
def set_width(self, width):
_gtkextra.gtk_plot_bar_set_width(self._o, width)
def get_width(self):
return _gtkextra.gtk_plot_bar_get_width(self._o)
_gtk._name2cls['GtkPlotBar'] = GtkPlotBar
class GtkPlotBox(GtkPlotData):
get_type = _gtkextra.gtk_plot_box_get_type
"""Return the internal value associated with a GtkPlotBox."""
def __init__(self, orientation=1, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_box_new(orientation)
_gtk._name2cls['GtkPlotBox'] = GtkPlotBox
class GtkPlotFlux(GtkPlotData):
get_type = _gtkextra.gtk_plot_flux_get_type
"""Return the internal value associated with a GtkPlotFlux."""
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_flux_new()
def set_arrow(self, arrow_length, arrow_width, symbol_style):
_gtkextra.gtk_plot_flux_set_arrow(self._o, arrow_length,
arrow_width, symbol_style)
def get_arrow(self):
return _gtkextra.gtk_plot_flux_get_arrow(self._o)
def center(self, center):
_gtkextra.gtk_plot_flux_center(self._o, center)
def is_centered(self):
return _gtkextra.gtk_plot_flux_is_centered(self._o)
_gtk._name2cls['GtkPlotFlux'] = GtkPlotFlux
class GtkPlotSurface(GtkPlotData):
get_type = _gtkextra.gtk_plot_surface_get_type
"""Return the internal value associated with a GtkPlotSurface."""
def __init__(self, function=None, _obj=None, *extra):
if _obj:
if function is not None:
extra = (_obj,) + extra
else:
self._o = _obj; return
self._o = _gtkextra.gtk_plot_surface_new(function, extra)
def set_numpoints(self, n):
raise AttributeError
def get_numpoints(self):
raise AttributeError
def set_color(self, color):
_gtkextra.gtk_plot_surface_set_color(self._o, color)
def set_shadow(self, color):
_gtkextra.gtk_plot_surface_set_shadow(self._o, color)
def set_grid_foreground(self, color):
_gtkextra.gtk_plot_surface_set_grid_foreground(self._o, color)
def set_grid_background(self, color):
_gtkextra.gtk_plot_surface_set_grid_background(self._o, color)
def set_grid_visible(self, visible):
_gtkextra.gtk_plot_surface_set_grid_visible(self._o, visible)
def get_grid_visible(self):
return _gtkextra.gtk_plot_surface_get_grid_visible(self._o)
def set_mesh_visible(self, visible):
_gtkextra.gtk_plot_surface_set_mesh_visible(self._o, visible)
def get_mesh_visible(self):
return _gtkextra.gtk_plot_surface_get_mesh_visible(self._o)
def set_light(self, x, y, z):
_gtkextra.gtk_plot_surface_set_light(self._o, x, y, z)
def set_ambient(self, ambient):
_gtkextra.gtk_plot_surface_set_ambient(self._o, ambient)
def set_points(self, x, y, z, dx, dy, dz, nx, ny):
_gtkextra.gtk_plot_surface_set_points(self._o, x, y, z, dx, dy,
dz, nx, ny)
def get_points(self):
return _gtkextra.gtk_plot_surface_get_points(self._o)
def set_nx(self, nx):
_gtkextra.gtk_plot_surface_set_nx(self._o, nx)
def get_nx(self):
return _gtkextra.gtk_plot_surface_get_nx(self._o)
def set_ny(self, ny):
_gtkextra.gtk_plot_surface_set_ny(self._o, ny)
def get_ny(self):
return _gtkextra.gtk_plot_surface_get_ny(self._o)
def set_x(self, array):
_gtkextra.gtk_plot_surface_set_x(self._o, array)
def set_y(self, array):
_gtkextra.gtk_plot_surface_set_y(self._o, array)
def set_z(self, array):
_gtkextra.gtk_plot_surface_set_z(self._o, array)
def set_dx(self, array):
_gtkextra.gtk_plot_surface_set_dx(self._o, array)
def set_dy(self, array):
_gtkextra.gtk_plot_surface_set_dy(self._o, array)
def set_dz(self, array):
_gtkextra.gtk_plot_surface_set_dz(self._o, array)
def get_x(self):
return _gtkextra.gtk_plot_surface_get_x(self._o)
def get_y(self):
return _gtkextra.gtk_plot_surface_get_y(self._o)
def get_z(self):
return _gtkextra.gtk_plot_surface_get_z(self._o)
def get_dx(self):
return _gtkextra.gtk_plot_surface_get_dx(self._o)
def get_dy(self):
return _gtkextra.gtk_plot_surface_get_dy(self._o)
def get_dz(self):
return _gtkextra.gtk_plot_surface_get_dz(self._o)
def set_xstep(self, xstep):
_gtkextra.gtk_plot_surface_set_xstep(self._o, xstep)
def get_xstep(self):
_gtkextra.gtk_plot_surface_get_xstep(self._o)
def set_ystep(self, ystep):
_gtkextra.gtk_plot_surface_set_ystep(self._o, ystep)
def get_ystep(self):
_gtkextra.gtk_plot_surface_get_ystep(self._o)
_gtk._name2cls['GtkPlotSurface'] = GtkPlotSurface
class GtkPlotCSurface(GtkPlotSurface):
get_type = _gtkextra.gtk_plot_csurface_get_type
"""Return the internal value associated with a GtkPlotCSurface."""
def __init__(self, function=None, _obj=None, *extra):
if _obj:
if function is not None:
extra = (_obj,) + extra
else:
self._o = _obj; return
self._o = _gtkextra.gtk_plot_csurface_new(function, extra)
def set_lines_visible(self, visible):
_gtkextra.gtk_plot_csurface_set_lines_visible(self._o, visible)
def get_lines_visible(self):
return _gtkextra.gtk_plot_csurface_set_lines_visible(self._o)
def set_lines_only(self, lines_only):
_gtkextra.gtk_plot_csurface_set_lines_only(self._o, lines_only)
def lines_only(self):
return _gtkextra.gtk_plot_csurface_lines_only(self._o)
def set_labels_visible(self, visible):
_gtkextra.gtk_plot_csurface_set_labels_visible(self._o, visible)
def labels_visible(self):
return _gtkextra.gtk_plot_csurface_labels_visible(self._o)
_gtk._name2cls['GtkPlotCSurface'] = GtkPlotCSurface
class GtkPlotPixmap(GtkPlotData):
get_type = _gtkextra.gtk_plot_pixmap_get_type
"""Return the internal value associated with a GtkPlotPixmap."""
def __init__(self, pixmap=None, mask=None, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_pixmap_new(pixmap, mask)
def get_pixmap(self):
return _gtkextra.gtk_plot_pixmap_get_pixmap(self._o)
def get_mask(self):
return _gtkextra.gtk_plot_pixmap_get_mask(self._o)
_gtk._name2cls['GtkPlotPixmap'] = GtkPlotPixmap
class GtkPlot(_gtk.GtkWidget):
"""This class implements a high-level, general purpose plotting
widget. You can display any set of data (set of points, curve defined
by a parametric function, ...). This widget can automatically display
them as a curve, along with labelled axis, axis tick marks, legends,...
It fully supports the drag-and-drop protocol for all of its children,
which means that the user can interactively move them in the GtkPlot
area.
A GtkPlot is closely associated with a GdkDrawable, on which all the
drawings are done. It can be done anywhere within that drawable, its
"position" is indicated by a tuple (X, Y), which are two values between
0.0 and 1.0 (from left to right, or from top to bottom).
Its size is also given as a ratio other the drawable's size.
Most points in the plot have also this relative coordinates systems,
which makes it really easy to handle resizing of a plot window.
"""
get_type = _gtkextra.gtk_plot_get_type
"""Return the internal value associated with a GtkPlot."""
def __init__(self, drawable=None, width=None, height=None, _obj=None):
"""Create a new plot, that will be displayed in drawable.
All the datasets, labels, axis,... associated with the plot
will be drawn in that drawable, which must have been created
beforehand. Note that the drawable can also be set later with
set_drawable.
"""
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_new(drawable, width, height)
def connect(self, name, f, *extra):
signals = {
'moved': _gtkextra._gtk_plot_callback_wrapper,
'resized': _gtkextra._gtk_plot_callback_wrapper,
}
if signals.has_key(name):
extra = extra + (f,)
f = signals[name]
return apply(_gtk.GtkWidget.connect, (self, name, f) + extra)
def set_drawable(self, drawable):
"""Modify the drawable on which the graphs are displayed.
From now on, all the drawings will be done on that drawable.
Note that they are not automatically copied to the new
drawable until the plot needs to be redrawn.
"""
_gtkextra.gtk_plot_set_drawable(self._o, drawable)
def get_drawable(self):
"""Return the drawable on which the graphs are plotted."""
return _gtkextra.gtk_plot_get_drawable(self._o)
def set_background(self, color):
"""Change the plot's background color.
Note that this has no effect if the plot has been set to
transparent.
The plot is also redrawn as soon as you modify this color.
"""
_gtkextra.gtk_plot_set_background(self._o, color)
def set_background_pixmap(self, pixmap):
"""Change the plot's background pixmap."""
_gtkextra.gtk_plot_set_background_pixmap(self._o, pixmap)
def set_transparent(self, transparent):
"""Indicate whether the background should be transparent
or not.
"""
_gtkextra.gtk_plot_set_transparent(self._o, transparent)
def is_transparent(self, transparent):
"""Return whether the background is transparent or not."""
return _gtkextra.gtk_plot_is_transparent(self._o)
def paint(self):
"""Force an immediate repaint of the widget in its pixmap.
The modification won't appear on the screen until you call
refresh().
It is probably not a good idea to call this function directly,
and it is more efficient to queue a draw request (see the
GtkWidget class for related functions).
"""
_gtkextra.gtk_plot_paint(self._o)
def refresh(self, area=None):
"""Copy the plot's pixmap to the screen.
The same comment as for paint() applies here, and you probably
don't have to call this function yourself, since queuing a
draw request is more efficient.
"""
_gtkextra.gtk_plot_refresh(self._o, area)
def set_magnification(self, magnification):
"""Change the magnification level of the plot.
1.0 is the default magnification, higher values will zoom in
while lower values will zoom out.
"""
_gtkextra.gtk_plot_set_magnification(self._o, magnification)
############################
## Coordinates and sizes ##
############################
def get_position(self):
"""Return the position of the plot within its drawable
as a 2-tuple. x and y are in the range 0.0 .. 1.0, where
(0.0, 0.0) is the top-left corner and (1.0, 1.0)
the bottom-right corner. The position can be changed with
move().
"""
return _gtkextra.gtk_plot_get_position(self._o)
def get_size(self):
"""Return the size of the plot as a 2-tuple. width and height
are both in the range 0.0 .. 1.0, where 1.0 means they
occupy all the space available in the drawable, 0.5 means they
only occupy half of it.
"""
return _gtkextra.gtk_plot_get_size(self._o)
def get_internal_allocation(self):
"""Return the real position/size of the plot inside its parent
container. You should use this function instead of converting
yourself the result of get_position() and get_size().
"""
return _gtkextra.gtk_plot_get_internal_allocation(self._o)
def move(self, x, y):
"""Move the plot widget inside its drawable.
x and y should both be in the range 0.0 .. 1.0 (from
top-left corner to bottom-right corner).
"""
_gtkextra.gtk_plot_move(self._o, x, y)
def resize(self, width, heigth):
"""Resize the widget.
width and height should both be in the range 0.0 .. 1.0,
this indicates which ratio of the drawable's screen
real-estate they should use.
"""
_gtkextra.gtk_plot_resize(self._o, width, height)
def move_resize(self, x, y, width, heigth):
"""Move and resize the widget in a single operation.
This is faster than doing each operation separately.
"""
_gtkextra.gtk_plot_move_resize(self._o, x, y, width, height)
def get_pixel(self, x, y):
"""Return the screen coordinates (relative to plot's parent)
of a point. The initial coordinates x and y should be in the
range 0.0 .. 1.0.
"""
return _gtkextra.gtk_plot_get_pixel(self._o, x, y)
def get_point(self, ix, iy):
"""Convert from an absolute screen coordinate to a relative
one. x and y should be relative to plot's parent.
This function is the opposite of get_pixel.
"""
return _gtkextra.gtk_plot_get_point(self._o, ix, iy)
def set_xrange(self, xmin, xmax):
"""Set the range of visible points for this plot.
Only the points of the graph those coordinates are in the
range xmin .. xmax will be visible.
"""
_gtkextra.gtk_plot_set_xrange(self._o, xmin, xmax)
def set_yrange(self, ymin, ymax):
"""Set the range of visible points for this plot.
Only the points of the graph those coordinates are in the
range Xmin .. Xmax will be visible.
"""
_gtkextra.gtk_plot_set_yrange(self._o, ymin, ymax)
def set_range(self, xmin, xmax, ymin, ymax):
"""Set both ranges at the same time."""
_gtkextra.gtk_plot_set_range(self._o, xmin, xmax, ymin, ymax)
def autoscale(self):
"""Calculate automatically the appropriate ranges for the
plot.
"""
_gtkextra.gtk_plot_autoscale(self._o)
def get_xrange(self):
"""Get the current range of the X axis."""
return _gtkextra.gtk_plot_get_xrange(self._o)
def get_yrange(self):
"""Get the current range of the Y axis."""
return _gtkextra.gtk_plot_get_yrange(self._o)
def set_xscale(self, scale_type):
"""Set the type of the X axis (logarithmic, linear, ...)."""
_gtkextra.gtk_plot_set_xscale(self._o, scale_type)
def set_yscale(self, scale_type):
"""Set the type of the Y axis (logarithmic, linear, ...)."""
_gtkextra.gtk_plot_set_yscale(self._o, scale_type)
def get_xscale(self):
"""Get the type of the X axis."""
return _gtkextra.gtk_plot_get_xscale(self._o)
def get_yscale(self):
"""Get the type of the Y axis."""
return _gtkextra.gtk_plot_get_yscale(self._o)
def get_axis(self, axis):
"""Get a pointer to an axis."""
return _gtkextra.gtk_plot_get_axis(self._o, axis)
def axis_set_visible(self, axis, visible):
"""Indicate whether the axis should be visible or not."""
_gtkextra.gtk_plot_axis_set_visible(self._o, axis, visible)
def axis_visible(self, axis):
"""Return the visibility state of the axis."""
return _gtkextra.gtk_plot_axis_visible(self._o, axis)
def axis_get_visible(self, axis):
return self.axis_visible()
def axis_set_title(self, axis, title):
"""Modify the title of the axis.
Each axis has a title that is displayed along its line
(vertically for the left and right sides).
"""
_gtkextra.gtk_plot_axis_set_title(self._o, axis, title)
def axis_show_title(self, axis):
"""Show the title associated with the axis."""
_gtkextra.gtk_plot_axis_show_title(self._o, axis)
def axis_hide_title(self, axis):
"""Hide the title associated with the axis."""
_gtkextra.gtk_plot_axis_hide_title(self._o, axis)
def axis_move_title(self, axis, angle, x, y):
"""Modify the position and orientation of the axis' title.
x and y indicate a position relative to the location of the
axis (0.0 to display it to the left (resp. top) of the axis,
1.0 to display it to the right (resp. bottom) of the axis.
"""
_gtkextra.gtk_plot_axis_move_title(self._o, axis, angle, x, y)
def axis_justify_title(self, axis, justification):
"""Modify the justification for the axis."""
_gtkextra.gtk_plot_axis_justify_title(self._o, axis,
justification)
def axis_set_attributes(self, axis, width, color):
"""Modify the attributes of the lines of the axis."""
_gtkextra.gtk_plot_axis_set_attributes(self._o, axis, width,
color)
def axis_get_attributes(self, axis):
"""Get the attributes of the axis."""
return _gtkextra.gtk_plot_axis_get_attributes(self._o, axis)
def axis_set_ticks(self, orientation, major_step, num_minor):
"""Set up ticks for a specific axis.
PLOT_AXIS_X will match the left and right sides, whereas
PLOT_AXIS_Y will match the top and bottom sides.
major_step is a percentage value of the widget size,
and indicates the step between each big ticks. For instance,
if major_step has a value of 0.2, there will be 5 big ticks
drawn along the axis. num_minor is the number of minor ticks
between each major one.
"""
_gtkextra.gtk_plot_axis_set_ticks(self._o, orientation,
major_step, num_minor)
def axis_set_major_ticks(self, orientation, major_step):
"""Modify the step for major ticks.
This is a percentage value that indicates how many major ticks
are drawn along the axis. See also axis_set_ticks().
"""
_gtkextra.gtk_plot_axis_set_major_ticks(self._o, orientation,
major_step)
def axis_set_minor_ticks(self, orientation, num_minor):
"""Modify the number of minor ticks between each major one.
See also axis_set_ticks().
"""
_gtkextra.gtk_plot_axis_set_minor_ticks(self._o, orientation,
num_minor)
def axis_set_ticks_length(self, axis, length):
"""Set the length (in pixels) of the big ticks.
The small ticks will have half this length.
"""
_gtkextra.gtk_plot_axis_set_ticks_length(self._o, axis, length)
def axis_set_ticks_width(self, axis, width):
"""Set the width (in pixels) of the ticks.
This width is common to both the long and short ticks.
"""
_gtkextra.gtk_plot_axis_set_ticks_width(self._o, axis, width)
def axis_show_ticks(self, axis, major_mask, minor_mask):
"""Set the style of the ticks."""
_gtkextra.gtk_plot_axis_show_ticks(self._o, axis, major_mask,
minor_mask)
def axis_set_ticks_limits(self, orientation, ticks_beg, ticks_end):
"""Indicate the area of the axis that should have ticks.
Ticks will be displayed only from ticks_beg to ticks_end.
"""
_gtkextra.gtk_plot_axis_set_ticks_limits(self._o, orientation,
ticks_beg, ticks_end)
def axis_unset_ticks_limits(self, orientation):
"""Cancel the ticks limits set by a previous call to
axis_set_ticks_limits().
"""
_gtkextra.gtk_plot_axis_unset_ticks_limits(self._o,
orientation)
def axis_show_labels(self, axis, label_mask):
"""Indicate whether a label should be drawn at each ticks to
indicate its value.
"""
_gtkextra.gtk_plot_axis_show_labels(self._o, axis, label_mask)
def axis_set_labels_suffix(self, axis, string):
_gtkextra.gtk_plot_axis_set_labels_suffix(self._o, axis,
string)
def axis_get_labels_suffix(self, axis):
return _gtkextra.gtk_plot_axis_get_labels_suffix(self._o,
axis)
def axis_set_labels_prefix(self, axis, string):
_gtkextra.gtk_plot_axis_set_labels_prefix(self._o, axis,
string)
def axis_get_labels_prefix(self, axis):
return _gtkextra.gtk_plot_axis_get_labels_prefix(self._o,
axis)
def axis_title_set_attributes(self, axis, fontname, height, angle,
foreground, background, transparent=1,
justification=2):
"""Set the attributes to be used for the title of the axis.
fontname should be the name of a PostScript font or None."""
_gtkextra.gtk_plot_axis_title_set_attributes(self._o, axis,
fontname, height,
angle,
foreground,
background,
transparent,
justification)
def axis_set_labels_attributes(self, axis, fontname, height, angle,
foreground, background, transparent=1,
justification=2):
"""Set the attributes to be used for the ticks labels.
fontname should be the name of a PostScript font or None.
"""
_gtkextra.gtk_plot_axis_set_labels_attributes(self._o, axis,
fontname, height,
angle,
foreground,
background,
transparent,
justification)
def axis_labels_set_attributes(self, axis, fontname, height, angle,
foreground, background):
"""Obsolete, use axis_set_labels_attributes() instead."""
self.axis_set_labels_attributes(axis, fontname, height, angle,
foreground, background)
def axis_set_labels_numbers(self, axis, label_style, precision):
"""Set the style of labels.
This indicates whether the labels should be displayed as
floating point values or in the scientific notation.
precision is the number of digits to be printed.
"""
_gtkextra.gtk_plot_axis_set_labels_numbers(self._o, axis,
label_style,
precision)
def axis_labels_set_numbers(self, axis, label_style, precision):
"""Obsolete, use axis_set_labels_numbers() instead."""
self.axis_set_labels_numbers(axis, label_style, precision)
def axis_set_tick_labels(self, axis, labels):
"""Modify the labels associated with the major ticks.
There should be as many items in labels as there are major
ticks along that axis, although this is not checked.
Note also that for these items to be visible you should call
axis_use_custom_tick_labels().
"""
_gtkextra.gtk_plot_axis_set_tick_labels(self._o, axis, labels)
def axis_use_custom_tick_labels(self, axis, custom):
"""Indicate which kind of labels should be used for major
ticks. If custom is TRUE, then the labels set by
axis_set_tick_labels() will be used.
"""
_gtkextra.gtk_plot_axis_use_custom_tick_labels(self._o, axis,
custom)
def x0_set_visible(self, visible):
"""Indicate whether the line at x==0 should be displayed."""
_gtkextra.gtk_plot_x0_set_visible(self._o, visible)
def x0_visible(self):
"""Return the visibility state of the line at x==0."""
return _gtkextra.gtk_plot_x0_visible(self._o)
def x0_get_visible(self):
return self.x0_visible()
def y0_set_visible(self, visible):
"""Indicate whether the line at y==0 should be displayed."""
_gtkextra.gtk_plot_y0_set_visible(self._o, visible)
def y0_visible(self):
"""Return the visibility state of the line at y==0."""
return _gtkextra.gtk_plot_y0_visible(self._o)
def y0_get_visible(self):
return self.y0_visible()
def x0line_set_attributes(self, line_style, width, color):
"""Set the attributes of the line at x==0."""
_gtkextra.gtk_plot_x0line_set_attributes(self._o, line_style,
width, color)
def y0line_set_attributes(self, line_style, width, color):
"""Set the attributes of the line at y==0."""
_gtkextra.gtk_plot_y0line_set_attributes(self._o, line_style,
width, color)
def grids_set_on_top(self, on_top):
_gtkextra.gtk_plot_grids_set_on_top(self._o, on_top)
def grids_on_top(self):
return _gtkextra.gtk_plot_grids_on_top(self._o)
def grids_set_visible(self, vmajor, vminor, hmajor, hminor):
"""Indicate whether the lines of the grids should be displayed.
You can decide separately whether the major and minor lines
should be displayed.
"""
_gtkextra.gtk_plot_grids_set_visible(self._o, vmajor, vminor,
hmajor, hminor)
def grids_visible(self):
"""Return the visibility state of the grid."""
return _gtkextra.gtk_plot_grids_visible(self._o)
def grids_get_visible(self):
return self.grids_visible()
def major_hgrid_set_attributes(self, line_style, width, color):
"""Set the attributes for the major horizontal lines in the
grid.
"""
_gtkextra.gtk_plot_major_hgrid_set_attributes(self._o,
line_style,
width, color)
def major_vgrid_set_attributes(self, line_style, width, color):
"""Set the attributes for the major vertical lines in the
grid.
"""
_gtkextra.gtk_plot_major_vgrid_set_attributes(self._o,
line_style,
width, color)
def minor_hgrid_set_attributes(self, line_style, width, color):
"""Set the attributes for the minor horizontal lines in the
grid.
"""
_gtkextra.gtk_plot_minor_hgrid_set_attributes(self._o,
line_style,
width, color)
def minor_vgrid_set_attributes(self, line_style, width, color):
"""Set the attributes for the minor vertical lines in the
grid.
"""
_gtkextra.gtk_plot_minor_vgrid_set_attributes(self._o,
line_style,
width, color)
def show_legends(self):
"""Indicate that the legend should be displayed."""
_gtkextra.gtk_plot_show_legends(self._o)
def hide_legends(self):
"""Indicate that the legend should not be displayed."""
_gtkextra.gtk_plot_hide_legends(self._o)
def set_legends_border(self, border_style, shadow_width=0):
"""Modify the way the borders of the legend look like."""
_gtkextra.gtk_plot_set_legends_border(self._o, border_style,
shadow_width)
def legends_move(self, x, y):
"""Move the legend relative to the widget's area.
x and y are percentage values. (0.0, 0.0) indicates the
top-left corner of the plot, (1.0, 1.0) indicates the
bottom-right corner.
"""
_gtkextra.gtk_plot_legends_move(self._o, x, y)
def legends_get_position(self):
"""Return the current position of the legend."""
return _gtkextra.gtk_plot_legends_get_position(self._o)
def legends_get_allocation(self):
"""Return the exact coordinates and size in pixels of the
legend. The coordinates are relative to the widget's parent
container.
"""
return _gtkextra.gtk_plot_legends_get_allocation(self._o)
def legends_set_attributes(self, fontname, height, foreground=None,
background=None):
"""Set the attributes to use when displaying the legend.
fontname is the name of a PostScript font or None.
"""
_gtkextra.gtk_plot_legends_set_attributes(self._o, fontname,
height, foreground,
background)
def set_line_attributes(self, line):
_gtkextra.gtk_plot_set_line_attributes(self._o, line)
def put_text(self, x, y, fontname, height, angle, foreground,
background, transparent, justification, string):
"""Print some text in the plot.
The text will be drawn at the relative coordinates (x, y),
with a specified angle. fontname should be the name of a
PostScript font or None. If fontname is None a default font
and default height will be used. Likewise, default colors will
be used if you don't specify any.
If transparent is TRUE, then no background will be drawn for
the text.
"""
return _gtkextra.gtk_plot_put_text(self._o, x, y,
fontname, height, angle,
foreground, background,
transparent, justification,
string)
def remove_text(self, text):
"""Remove some text that is currently visible on the plot.
Nothing is done if text is currently not visible.
"""
return _gtkextra.gtk_plot_remove_text(self._o, text)
def add_data(self, data):
"""Add an existing set of data to the plot.
This set will automatically be drawn the next time the plot
itself is drawn.
"""
_gtkextra.gtk_plot_add_data(self._o, data._o)
def remove_data(self, data):
"""Remove the dataset from plot.
This function returns TRUE if the dataset was indeed found
and could be removed, FALSE otherwise.
"""
return _gtkextra.gtk_plot_remove_data(self._o, data._o)
def add_function(self, function, *extra):
"""Allocate a new dataset, whose point are automatically
calculated. function is a callable object that takes the X
coordinate value, and should return the Y coordinate value.
The set is automatically added to the plot, so you don't need
to explicitly call add_data().
"""
data = _gtkextra.gtk_plot_add_function(self._o, function,
extra)
if data:
data = _gtk._obj2inst(data)
return data
def clip_data(self, clip):
"""If the argument is TRUE the plot data is clipped to fit
the frame.
"""
_gtkextra.gtk_plot_clip_data(self._o, clip)
def export_ps(self, filename, orientation=PLOT_PORTRAIT, eps=0,
paper_size=PLOT_LETTER):
"""Create a new PostScript file with the content of the plot.
eps should be TRUE if the generated file should be in
Encapsulated PostScript format instead of simple PostScript.
"""
return _gtkextra.gtk_plot_export_ps(self._o, filename,
orientation, eps,
paper_size)
def export_ps_with_size(self, filename, orientation=PLOT_PORTRAIT,
eps=0, units=PLOT_PSPOINTS,
width=PLOT_LETTER_W, height=PLOT_LETTER_H):
"""Create a new PostScript file with the content of the
plot. eps should be TRUE if the generated file should be in
Encapsulated PostScript format instead of simple PostScript.
The page has a custom size.
"""
return _gtkextra.gtk_plot_export_ps_with_size(self._o,
filename,
orientation, eps,
units, width,
height)
_gtk._name2cls['GtkPlot'] = GtkPlot
class GtkPlotPolar(GtkPlot):
get_type = _gtkextra.gtk_plot_polar_get_type
def __init__(self, drawable=None, width=None, height=None, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_polar_new(drawable, width, height)
def rotate(self, angle):
_gtkextra.gtk_plot_polar_rotate(self._o, angle)
_gtk._name2cls['GtkPlotPolar'] = GtkPlotPolar
class GtkPlot3D(GtkPlot):
get_type = _gtkextra.gtk_plot3d_get_type
def __init__(self, drawable=None, width=None, height=None, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot3d_new(drawable, width, height)
def autoscale(self):
_gtkextra.gtk_plot3d_autoscale(self._o)
def rotate(self, angle_x, angle_y, angle_z):
_gtkextra.gtk_plot3d_rotate(self._o, angle_x, angle_y, angle_z)
def rotate_vector(self, vector, a1, a2, a3):
_gtkextra.gtk_plot3d_rotate_vector(self._o, a1, a2, a3)
def reset_angles(self):
_gtkextra.gtk_plot3d_reset_angles(self._o)
def rotate_x(self, angle):
_gtkextra.gtk_plot3d_rotate_x(self._o, angle)
def rotate_y(self, angle):
_gtkextra.gtk_plot3d_rotate_y(self._o, angle)
def rotate_z(self, angle):
_gtkextra.gtk_plot3d_rotate_z(self._o, angle)
def get_pixel(self, x, y, z):
return _gtkextra.gtk_plot3d_get_pixel(self._o, x, y, z)
def set_xrange(self, xmin, xmax):
_gtkextra.gtk_plot3d_set_xrange(self._o, xmin, xmax)
def set_yrange(self, ymin, ymax):
_gtkextra.gtk_plot3d_set_yrange(self._o, ymin, ymax)
def set_zrange(self, zmin, zmax):
_gtkextra.gtk_plot3d_set_zrange(self._o, zmin, zmax)
def set_xfactor(self, xmin, xmax):
_gtkextra.gtk_plot3d_set_xfactor(self._o, xfactor)
def get_xfactor(self):
return _gtkextra.gtk_plot3d_get_xfactor(self._o)
def set_yfactor(self, ymin, ymax):
_gtkextra.gtk_plot3d_set_yfactor(self._o, yfactor)
def get_yfactor(self):
return _gtkextra.gtk_plot3d_get_yfactor(self._o)
def set_zfactor(self, zmin, zmax):
_gtkextra.gtk_plot3d_set_zfactor(self._o, zfactor)
def get_zfactor(self):
return _gtkextra.gtk_plot3d_get_zfactor(self._o)
def plane_set_color(self, plane, color):
_gtkextra.gtk_plot3d_plane_set_color(self._o, plane, color)
def plane_set_visible(self, plane, visible):
_gtkextra.gtk_plot3d_plane_set_visible(self._o, plane, visible)
def plane_visible(self, plane):
return _gtkextra.gtk_plot3d_plane_visible(self._o, plane)
def plane_get_visible(self, plane):
return self.plane_visible(plane)
def corner_set_visible(self, visible):
_gtkextra.gtk_plot3d_corner_set_visible(self._o, visible)
def corner_visible(self):
return _gtkextra.gtk_plot3d_corner_visible(self._o)
def corner_get_visible(self):
return self.corner_visible()
def corner_set_attributes(self, line_style, width, color):
_gtkextra.gtk_plot3d_corner_set_attributes(self._o, line_style,
width, color)
def corner_get_attributes(self):
return _gtkextra.gtk_plot3d_corner_get_attributes(self._o)
def frame_set_attributes(self, line_style, width, color):
_gtkextra.gtk_plot3d_frame_set_attributes(self._o, line_style,
width, color)
def frame_get_attributes(self):
return _gtkextra.gtk_plot3d_frame_get_attributes(self._o)
def get_axis(self, orientation):
return _gtkextra.gtk_plot3d_get_axis(self._o)
def get_side(self, side):
return _gtkextra.gtk_plot3d_get_side(self._o)
def axis_show_major_ticks(self, side, ticks_mask):
_gtkextra.gtk_plot3d_axis_show_major_ticks(self._o, side,
ticks_mask)
def axis_show_minor_ticks(self, side, ticks_mask):
_gtkextra.gtk_plot3d_axis_show_minor_ticks(self._o, side,
ticks_mask)
def axis_show_labels(self, side, label_mask):
_gtkextra.gtk_plot3d_axis_show_labels(self._o, side,
label_mask)
def axis_show_title(self, side):
_gtkextra.gtk_plot3d_axis_show_title(self._o, side)
def axis_hide_title(self, side):
_gtkextra.gtk_plot3d_axis_hide_title(self._o, side)
def axis_set_ticks(self, orientation, major_step, num_minor):
_gtkextra.gtk_plot3d_axis_set_ticks(self._o, orientation,
major_step, num_minor)
def axis_set_major_ticks(self, orientation, major_step):
_gtkextra.gtk_plot3d_axis_set_major_ticks(self._o, orientation,
major_step)
def axis_set_minor_ticks(self, orientation, num_minor):
_gtkextra.gtk_plot3d_axis_set_minor_ticks(self._o, orientation,
num_minor)
def axis_set_ticks_length(self, orientation, length):
_gtkextra.gtk_plot3d_axis_set_ticks_length(self._o,
orientation, length)
def axis_set_ticks_width(self, orientation, width):
_gtkextra.gtk_plot3d_axis_set_ticks_width(self._o, orientation,
width)
def axis_show_ticks(self, side, major_mask, minor_mask):
_gtkextra.gtk_plot3d_axis_show_ticks(self._o, side,
major_mask, minor_mask)
def set_titles_offset(self, offset):
_gtkextra.gtk_plot3d_set_titles_offset(self._o, offset)
def get_titles_offset(self):
return _gtkextra.gtk_plot3d_get_titles_offset(self._o)
def major_grids_set_visible(self, x, y ,z):
_gtkextra.gtk_plot3d_major_grids_set_visible(self._o, x, y ,z)
def major_grids_visible(self):
return _gtkextra.gtk_plot3d_major_grids_visible(self._o)
def major_grids_get_visible(self):
return self.major_grids_visible()
def minor_grids_set_visible(self, x, y ,z):
_gtkextra.gtk_plot3d_minor_grids_set_visible(self._o, x, y ,z)
def minor_grids_visible(self):
return _gtkextra.gtk_plot3d_minor_grids_visible(self._o)
def minor_grids_get_visible(self):
return self.minor_grids_visible()
def major_zgrid_set_attributes(self, line_style, width, color):
_gtkextra.gtk_plot3d_major_zgrid_set_attributes(self._o,
line_style,
width, color)
def major_zgrid_get_attributes(self):
return _gtkextra.gtk_plot3d_major_zgrid_get_attributes(self._o)
def minor_zgrid_set_attributes(self, line_style, width, color):
_gtkextra.gtk_plot3d_minor_zgrid_set_attributes(self._o,
line_style,
width, color)
def minor_zgrid_get_attributes(self):
return _gtkextra.gtk_plot3d_minor_zgrid_get_attributes(self._o)
_gtk._name2cls['GtkPlot3D'] = GtkPlot3D
class GtkPlotCanvas(_gtk.GtkFixed):
get_type = _gtkextra.gtk_plot_canvas_get_type
def __init__(self, width=None, height=None, magnification=1.0,
_obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_plot_canvas_new(width, height,
magnification)
def __getattr__(self, attr):
attrs = {
'pixmap': _gtkextra.gtk_plot_canvas_get_pixmap,
}
if attrs.has_key(attr):
return attrs[attr](self._o)
return _gtk.GtkFixed.__getattr__(self, attr)
def add_plot(self, plot, x, y):
_gtkextra.gtk_plot_canvas_add_plot(self._o, plot._o, x, y)
def cancel_action(self):
_gtkextra.gtk_plot_canvas_cancel_action(self._o)
def child_move(self, child, x1, y1):
_gtkextra.gtk_plot_canvas_child_move(self._o, child, x1, y1)
def child_move_resize(self, child, x1, y1, x2, y2):
_gtkextra.gtk_plot_canvas_child_move_resize(self._o, child,
x1, y1, x2, y2)
def export_ps(self, filename, orientation=PLOT_PORTRAIT, eps=0,
paper_size=PLOT_LETTER):
return _gtkextra.gtk_plot_canvas_export_ps(self._o, filename,
orientation, eps,
paper_size)
def export_ps_with_size(self, filename, orientation=PLOT_PORTRAIT,
eps=0, units=PLOT_PSPOINTS,
width=PLOT_LETTER_W, height=PLOT_LETTER_H):
return _gtkextra.gtk_plot_canvas_export_ps_with_size(self._o,
filename,
orientation,
eps,
units,
width,
height)
def get_active_plot(self):
plot = _gtkextra.gtk_plot_canvas_get_active_plot(self._o)
if plot:
plot = _gtk._obj2inst(plot)
return plot
def get_active_data(self):
plot_data = _gtkextra.gtk_plot_canvas_get_active_data(self._o)
if plot_data:
plot_data = _gtk._obj2inst(plot_data)
return plot_data
def get_active_point(self):
"""Return a tuple with the active point's data offset and
coordinates. Return None if no point is active.
"""
return _gtkextra.gtk_plot_canvas_get_active_point(self._o)
def get_active_item(self):
return _gtkextra.gtk_plot_canvas_get_active_item(self._o)
def get_pixel(self, x, y):
return _gtkextra.gtk_plot_canvas_get_pixel(self._o, x, y)
def get_position(self, ix, iy):
return _gtkextra.gtk_plot_canvas_get_position(self._o, ix, iy)
def grid_set_attributes(self, line_style, width, color=None):
_gtkextra.gtk_plot_canvas_grid_set_attributes(self._o,
line_style,
width, color)
def grid_set_step(self, step):
_gtkextra.gtk_plot_canvas_grid_set_step(self._o, step)
def grid_set_visible(self, visible):
_gtkextra.gtk_plot_canvas_grid_set_visible(self._o, visible)
def put_text(self, x, y, angle, fontname, height, foreground,
background, trans, just, string):
return _gtkextra.gtk_plot_canvas_put_text(self._o, x, y, angle,
fontname, height,
foreground,
background,
trans, just,
string)
def put_line(self, x1, y1, x2, y2, line_style, width, color,
arrow_mask):
return _gtkextra.gtk_plot_canvas_put_line(self._o, x1, y1, x2,
y2, line_style,
width, color,
arrow_mask)
def put_rectangle(self, x1, y1, x2, y2, line_style, width,
foreground, background, border_style, fill):
return _gtkextra.gtk_plot_canvas_put_rectangle(self._o, x1, y1,
x2, y2,
line_style,
width,
foreground,
background,
border_style,
fill)
def put_ellipse(self, x1, y1, x2, y2, line_style, width,
foreground, background, fill):
return _gtkextra.gtk_plot_canvas_put_ellipse(self._o, x1, y1,
x2, y2,
line_style, width,
foreground,
background, fill)
def put_pixmap(self, pixmap, x1, y1):
return _gtkextra.gtk_plot_canvas_put_pixmap(self._o, pixmap,
x1, y1)
def put_child(self, child, x1, y1, x2, y2):
_gtkextra.gtk_plot_canvas_put_child(self._o, child, x1, y1,
x2, y2)
def paint(self):
_gtkextra.gtk_plot_canvas_paint(self._o)
def refresh(self):
_gtkextra.gtk_plot_canvas_refresh(self._o)
def remove_child(self, child):
return _gtkextra.gtk_plot_canvas_remove_child(self._o, child)
def set_active_plot(self, plot):
_gtkextra.gtk_plot_canvas_set_active_plot(self._o, plot._o)
def set_background(self, color):
_gtkextra.gtk_plot_canvas_set_background(self._o, color)
def set_magnification(self, magnification):
_gtkextra.gtk_plot_canvas_set_magnification(self._o,
magnification)
def set_size(self, width, height):
_gtkextra.gtk_plot_canvas_set_size(self._o, width, height)
def unselect(self):
_gtkextra.gtk_plot_canvas_unselect(self._o)
def plot_canvas_set_flags(self, flags):
_gtkextra.GTK_PLOT_CANVAS_SET_FLAGS(self._o, flags)
def plot_canvas_unset_flags(self, flags):
_gtkextra.GTK_PLOT_CANVAS_UNSET_FLAGS(self._o, flags)
_gtk._name2cls['GtkPlotCanvas'] = GtkPlotCanvas
class GtkIconList(_gtk.GtkFixed):
get_type = _gtkextra.gtk_icon_list_get_type
def __init__(self, icon_width=48, mode=ICON_LIST_TEXT_BELOW,
_obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_icon_list_new(icon_width, mode)
def __getattr__(self, attr):
attrs = {
'num_icons': _gtkextra.gtk_icon_list_get_num_icons,
}
if attrs.has_key(attr):
return attrs[attr](self._o)
return _gtk.GtkFixed.__getattr__(self, attr)
def __len__(self):
return self.num_icons
def __getitem__(self, key):
return self.get_nth(key)
def add(self, filename, label=None, object=None):
return _gtkextra.gtk_icon_list_add(self._o, filename, label,
object)
def add_from_data(self, data, label=None, object=None):
return _gtkextra.gtk_icon_list_add_from_data(self._o, data,
label, object)
def add_from_pixmap(self, pixmap, mask=None, label=None, object=None):
return _gtkextra.gtk_icon_list_add_from_pixmap(self._o, pixmap,
mask, label,
object)
def clear(self):
_gtkextra.gtk_icon_list_clear(self._o)
def freeze(self):
_gtkextra.gtk_icon_list_freeze(self._o)
def get_active_icon(self):
return _gtkextra.gtk_icon_list_get_active_icon(self._o)
def get_icon_at(self, x, y):
return _gtkextra.gtk_icon_list_get_icon_at(self._o, x, y)
def get_icon_from_link(self, object):
return _gtkextra.gtk_icon_list_get_icon_from_link(self._o,
object)
def get_index(self, item):
return _gtkextra.gtk_icon_list_get_index(self._o, item)
def get_nth(self, n):
return _gtkextra.gtk_icon_list_get_nth(self._o, n)
def remove(self, item):
_gtkextra.gtk_icon_list_remove(self._o, item)
def remove_nth(self, n):
_gtkextra.gtk_icon_list_remove_nth(self._o, n)
def select_icon(self, item):
_gtkextra.gtk_icon_list_select_icon(self._o, item)
def set_active_icon(self, item):
_gtkextra.gtk_icon_list_set_active_icon(self._o, item)
def set_background(self, color):
_gtkextra.gtk_icon_list_set_background(self._o, color)
def set_label(self, item, label):
_gtkextra.gtk_icon_list_set_label(self._o, item, label)
def set_selection_mode(self, mode):
_gtkextra.gtk_icon_list_set_selection_mode(self._o, mode)
def thaw(self):
_gtkextra.gtk_icon_list_thaw(self._o)
def unselect_all(self):
_gtkextra.gtk_icon_list_unselect_all(self._o)
def unselect_icon(self, item):
_gtkextra.gtk_icon_list_unselect_icon(self._o, item)
def update(self):
_gtkextra.gtk_icon_list_update(self._o)
def set_mode(self, mode):
_gtkextra.gtk_icon_list_set_mode(self._o, mode)
def get_mode(self):
return _gtkextra.gtk_icon_list_get_mode(self._o)
def set_editable(self, set_editable):
_gtkextra.gtk_icon_list_set_editable(self._o, set_editable)
def is_editable(self):
return _gtkextra.gtk_icon_list_is_editable(self._o)
def set_row_spacing(self, spacing):
_gtkextra.gtk_icon_list_set_row_spacing(self._o, spacing)
def get_row_spacing(self):
return _gtkextra.gtk_icon_list_get_row_spacing(self._o)
def set_col_spacing(self, spacing):
_gtkextra.gtk_icon_list_set_col_spacing(self._o, spacing)
def get_col_spacing(self):
return _gtkextra.gtk_icon_list_get_col_spacing(self._o)
def set_text_space(self, size):
_gtkextra.gtk_icon_list_set_text_space(self._o, size)
def get_text_space(self):
return _gtkextra.gtk_icon_list_get_text_space(self._o)
def set_icon_border(self, width):
_gtkextra.gtk_icon_list_set_icon_border(self._o, width)
def get_icon_border(self):
return _gtkextra.gtk_icon_list_get_icon_border(self._o)
def set_icon_width(self, width):
_gtkextra.gtk_icon_list_set_icon_width(self._o, width)
def get_icon_width(self):
return _gtkextra.gtk_icon_list_get_icon_width(self._o)
_gtk._name2cls['GtkIconList'] = GtkIconList
class GtkDirTree(_gtk.GtkCTree):
get_type = _gtkextra.gtk_dir_tree_get_type
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_dir_tree_new()
def open_dir(self, path):
return _gtkextra.gtk_dir_tree_open_dir(self._o, path)
_gtk._name2cls['GtkDirTree'] = GtkDirTree
class GtkFileList(GtkIconList):
get_type = _gtkextra.gtk_file_list_get_type
def __init__(self, icon_width=20, mode=ICON_LIST_TEXT_RIGHT, path=None,
_obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_file_list_new(icon_width, mode, path)
def add_type(self, data):
"""Add a pixmap for a new file type.
Returns the type number.
"""
return _gtkextra.gtk_file_list_add_type(self._o, data)
def add_type_filter(self, type, pattern):
"""Associate a shell wildcard pattern with a file type."""
_gtkextra.gtk_file_list_add_type_filter(self._o, type, pattern)
def get_filename(self):
"""Return the name of the selected file or an empty string."""
return _gtkextra.gtk_file_list_get_filename(self._o)
def get_filetype(self):
"""Return the file type or -1 if no file is selected."""
return _gtkextra.gtk_file_list_get_filetype(self._o)
def get_path(self):
"""Return the path."""
return _gtkextra.gtk_file_list_get_path(self._o)
def open_dir(self, path):
"""Open a directory."""
return _gtkextra.gtk_file_list_open_dir(self._o, path)
def set_filter(self, pattern):
_gtkextra.gtk_file_list_set_filter(self._o, pattern)
_gtk._name2cls['GtkFileList'] = GtkFileList
class GtkIconFileSelection(_gtk.GtkWindow):
get_type = _gtkextra.gtk_icon_file_selection_get_type
def __init__(self, title='', _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_icon_file_selection_new(title)
def __getattr__(self, attr):
attrs = {
'path_label': _gtkextra.gtk_icon_file_selection_get_path_label,
'dir_tree': _gtkextra.gtk_icon_file_selection_get_dir_tree,
'file_list': _gtkextra.gtk_icon_file_selection_get_file_list,
'file_entry': _gtkextra.gtk_icon_file_selection_get_file_entry,
'filter_entry': _gtkextra.gtk_icon_file_selection_get_filter_entry,
'ok_button': _gtkextra.gtk_icon_file_selection_get_ok_button,
'cancel_button': _gtkextra.gtk_icon_file_selection_get_cancel_button,
'action_area': _gtkextra.gtk_icon_file_selection_get_action_area,
}
if attrs.has_key(attr):
return _gtk._obj2inst(attrs[attr](self._o))
return _gtk.GtkWindow.__getattr__(self, attr)
def open_dir(self, path):
return _gtkextra.gtk_icon_file_selection_open_dir(self._o, path)
def show_hidden(self, visible):
_gtkextra.gtk_icon_file_selection_show_hidden(self._o, visible)
def show_tree(self, visible):
_gtkextra.gtk_icon_file_selection_show_tree(self._o, visible)
def set_filter(self, pattern):
_gtkextra.gtk_icon_file_selection_set_filter(self._o, pattern)
_gtk._name2cls['GtkIconFileSel'] = GtkIconFileSelection
class GtkItemEntry(_gtk.GtkEntry):
get_type = _gtkextra.gtk_item_entry_get_type
def __init__(self, maxlen=-1, _obj=None):
if _obj: self._o = _obj; return
if maxlen == -1:
self._o = _gtkextra.gtk_item_entry_new()
else:
self._o = _gtkextra.gtk_item_entry_new_with_max_length(maxlen)
def set_text(self, string, justification=None):
if justification is None:
_gtk.GtkEntry.set_text(self, string)
else:
_gtkextra.gtk_item_entry_set_text(self._o, string,
justification)
def set_justification(self, justification):
_gtkextra.gtk_item_entry_set_justification(self._o,
justification)
def get_justification(self):
return _gtkextra.gtk_item_entry_get_justification(self._o)
_gtk._name2cls['GtkItemEntry'] = GtkItemEntry
class GtkFontCombo(_gtk.GtkToolbar):
get_type = _gtkextra.gtk_font_combo_get_type
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_font_combo_new()
def __getattr__(self, attr):
attrs = {
'name_combo': _gtkextra.gtk_font_combo_get_name_combo,
'size_combo': _gtkextra.gtk_font_combo_get_size_combo,
'bold_button': _gtkextra.gtk_font_combo_get_bold_button,
'italic_button': _gtkextra.gtk_font_combo_get_italic_button,
'psfont': _gtkextra.gtk_font_combo_get_psfont,
'font': _gtkextra.gtk_font_combo_get_font,
'height': _gtkextra.gtk_font_combo_get_height,
'italic': _gtkextra.gtk_font_combo_get_italic,
'bold': _gtkextra.gtk_font_combo_get_bold
}
if attrs.has_key(attr):
ret = attrs[attr](self._o)
if type(ret) == _gtk._gtk.GtkObjectType:
return _gtk._obj2inst(ret)
return ret
return _gtk.GtkToolbar.__getattr__(self, attr)
def select(self, family, bold, italic, height):
_gtkextra.gtk_font_combo_select(self._o, family, bold, italic,
height)
def select_nth(self, n, bold, italic, height):
_gtkextra.gtk_font_combo_select(self._o, n, bold, italic,
height)
_gtk._name2cls['GtkFontCombo'] = GtkFontCombo
class GtkComboBox(_gtk.GtkHBox):
get_type = _gtkextra.gtk_combo_box_get_type
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_combo_box_new()
def __getattr__(self, attr):
attrs = {
'button': _gtkextra.gtk_combo_box_get_button,
'arrow': _gtkextra.gtk_combo_box_get_arrow,
'popup': _gtkextra.gtk_combo_box_get_popup,
'popwin': _gtkextra.gtk_combo_box_get_popwin,
'frame': _gtkextra.gtk_combo_box_get_frame
}
if attrs.has_key(attr):
return _gtk._obj2inst(attrs[attr](self._o))
return _gtk.GtkHBox.__getattr__(self, attr)
def hide_popdown_window(self):
_gtkextra.gtk_combo_box_hide_popdown_window(self._o)
_gtk._name2cls['GtkComboBox'] = GtkComboBox
class GtkBorderCombo(GtkComboBox):
get_type = _gtkextra.gtk_border_combo_get_type
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_border_combo_new()
_gtk._name2cls['GtkBorderCombo'] = GtkBorderCombo
class GtkColorCombo(GtkComboBox):
get_type = _gtkextra.gtk_color_combo_get_type
def __init__(self, rows=0, columns=0, colors=None, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_color_combo_new(rows, columns, colors)
def find_color(color):
return _gtkextra.gtk_color_combo_find_color(self._o, color)
def get_color_at(self, row, column):
return _gtkextra.gtk_color_combo_get_color_at(self._o, row,
column)
_gtk._name2cls['GtkColorCombo'] = GtkColorCombo
class GtkToggleCombo(GtkComboBox):
get_type = _gtkextra.gtk_toggle_combo_get_type
def __init__(self, rows=0, columns=0, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_toggle_combo_new(rows, columns)
def get_nrows(self):
return _gtkextra.gtk_toggle_combo_get_nrows(self._o)
def get_ncols(self):
return _gtkextra.gtk_toggle_combo_ncols(self._o)
def select(self, row, column):
_gtkextra.gtk_toggle_combo_select(self._o, row, column)
def get_selection(self):
return _gtkextra.gtk_toggle_combo_get_selection(self._o)
_gtk._name2cls['GtkToggleCombo'] = GtkToggleCombo
class GtkCharSelection(_gtk.GtkWindow):
get_type = _gtkextra.gtk_char_selection_get_type
def __init__(self, _obj=None):
if _obj: self._o = _obj; return
self._o = _gtkextra.gtk_char_selection_new()
def __getattr__(self, attr):
attrs = {
'font_combo': _gtkextra.gtk_char_selection_get_font_combo,
'ok_button': _gtkextra.gtk_char_selection_get_ok_button,
'cancel_button': _gtkextra.gtk_char_selection_get_cancel_button,
}
if attrs.has_key(attr):
return _gtk._obj2inst(attrs[attr](self._o))
return _gtk.GtkWindow.__getattr__(self, attr)
def set_selection(self, code):
_gtkextra.gtk_char_selection_set_selection(self._o, code)
def get_selection(self):
return _gtkextra.gtk_char_selection_get_selection(self._o)
_gtk._name2cls['GtkCharSelection'] = GtkCharSelection
GtkCheckItem = _gtk.GtkCheckButton
GtkSheetRange = _gtkextra.GtkSheetRange
GtkPlotLine = _gtkextra.GtkPlotLine
def psfont_init():
return _gtkextra.gtk_psfont_init()
def psfont_unref():
_gtkextra.gtk_psfont_unref()
def psfont_get_font(fontname):
return _gtkextra.gtk_psfont_get_font(fontname)
def psfont_get_gdkfont(fontname, height):
return _gtkextra.gtk_psfont_get_gdkfont(fontname, height)
def psfont_get_psfontname(fontname):
return _gtkextra.gtk_psfont_get_psfontname(fontname)
def psfont_add_font(fontname, psfont, family, xfont, italic, bold):
_gtkextra.gtk_psfont_add_font(fontname, psfont, family, xfont, italic,
bold)
def psfont_add_i18n_font(fontname, psfont, family, i18n_latinfamily, xfont,
italic, bold, vertical):
_gtkextra.gtk_psfont_add_i18n_font(fontname, psfont, family,
i18n_latinfamily, xfont, italic,
bold, vertical)
def psfont_find_by_family(family, italic, bold):
return _gtkextra.gtk_psfont_find_by_family(family, italic, bold)
def psfont_get_families():
return _gtkextra.gtk_psfont_get_families()
|