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
|
<?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-gtkactiongroup">
<refnamediv>
<refname>gtk.ActionGroup</refname>
<refpurpose>a group of actions (new in PyGTK 2.4)</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtk.ActionGroup</classname></ooclass>
<ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link linkend="constructor-gtkactiongroup">gtk.ActionGroup</link></methodname>
<methodparam><parameter role="keyword">name</parameter></methodparam>
</constructorsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--get-name">get_name</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--get-sensitive">get_sensitive</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--set-sensitive">set_sensitive</link></methodname>
<methodparam><parameter role="keyword">sensitive</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--get-visible">get_visible</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--set-visible">set_visible</link></methodname>
<methodparam><parameter role="keyword">visible</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--get-action">get_action</link></methodname>
<methodparam><parameter role="keyword">action_name</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--list-actions">list_actions</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--add-action">add_action</link></methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--add-action-with-accel">add_action_with_accel</link></methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
<methodparam><parameter role="keyword">accelerator</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--remove-action">remove_action</link></methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--add-actions">add_actions</link></methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--add-toggle-actions">add_toggle_actions</link></methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--add-radio-actions">add_radio_actions</link></methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">value</parameter><initializer>0</initializer></methodparam>
<methodparam><parameter role="keyword">on_change</parameter><initializer>None</initializer></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--set-translation-domain">set_translation_domain</link></methodname>
<methodparam><parameter role="keyword">domain</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkactiongroup--translate-string">translate_string</link></methodname>
<methodparam><parameter role="keyword">string</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
+-- <link linkend="class-gtkactiongroup">gtk.ActionGroup</link>
</synopsis>
</refsect1>
<refsect1>
<title>Implemented Interfaces</title>
<para>
<link linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
implements
<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
</para>
</refsect1>
<refsect1 id="properties-gtkactiongroup">
<title>gtk.ActionGroup Properties</title>
<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="4in"/>
<tbody>
<row valign="top">
<entry>"name"</entry>
<entry>Read-Write</entry>
<entry>A name for the action group.</entry>
</row>
<row valign="top">
<entry>"sensitive"</entry>
<entry>Read-Write</entry>
<entry>If <literal>True</literal>, the action group is
enabled.</entry>
</row>
<row valign="top">
<entry>"visible"</entry>
<entry>Read-Write</entry>
<entry>If <literal>True</literal>, the action group is
visible.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="signal-prototypes-gtkactiongroup">
<title>gtk.ActionGroup Signal Prototypes</title>
<para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
<variablelist>
<varlistentry>
<term>"<link linkend="signal-gtkactiongroup--connect-proxy">connect-proxy</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>proxy</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link linkend="signal-gtkactiongroup--disconnect-proxy">disconnect-proxy</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>proxy</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link linkend="signal-gtkactiongroup--post-activate">post-activate</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link linkend="signal-gtkactiongroup--pre-activate">pre-activate</link>"</term>
<listitem>
<methodsynopsis language="python"><methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<note>
<para>This object is available in PyGTK 2.4 and above.</para>
</note>
<para><link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> objects
are organized into <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
objects. An action group is basically a map from names to <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link>
objects.</para>
<para>All actions that would make sense to use in a particular context
should be in a single action group. Multiple action groups may be used for a
particular user interface. In fact, it is expected that most nontrivial
applications will make use of multiple groups. For example, in an
application that can edit multiple documents, there could be one group
holding global actions (e.g. quit, about, new), and one group per document
holding actions that act on that document (e.g. save, cut/copy/paste,
etc). Each window's menus would be constructed from a combination of the two
action groups.</para>
<para>Accelerators are handled by the GTK+ accelerator map. All actions
are assigned an accelerator path (which normally has the form
"<Actions>/group-name/action-name") and a shortcut is associated with
this accelerator path. All menuitems and toolitems take on this accelerator
path. The GTK+ accelerator map code makes sure that the correct shortcut is
displayed next to the menu item.</para>
</refsect1>
<refsect1 id="constructor-gtkactiongroup">
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname>gtk.ActionGroup</methodname>
<methodparam><parameter role="keyword">name</parameter></methodparam>
</constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">name</parameter> :</term>
<listitem><simpara>the name of the action group.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the new <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link></simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This constructor is available in PyGTK 2.4 and above.</para>
</note>
<para>Creates a new <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
object with the name specified by <parameter>name</parameter>. The name of
the action group is used when associating keybindings with the
actions.</para>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gtkactiongroup--get-name">
<title>gtk.ActionGroup.get_name</title>
<programlisting><methodsynopsis language="python">
<methodname>get_name</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the name of the action
group.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>get_name</methodname>() method returns the value
of the "name" property that contains the name of the action group.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--get-sensitive">
<title>gtk.ActionGroup.get_sensitive</title>
<programlisting><methodsynopsis language="python">
<methodname>get_sensitive</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the group is
sensitive.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>get_sensitive</methodname>() method returns the
value of the "sensitive" property. If "sensitive" is <literal>True</literal>
the group is enabled. The constituent actions can only be logically
sensitive (see the <link
linkend="method-gtkaction--is-sensitive"><methodname>gtk.Action.is_sensitive()</methodname></link>
method) if they are sensitive (see the <link
linkend="method-gtkaction--get-sensitive"><methodname>gtk.Action.get_sensitive()</methodname></link>
method) and their group is sensitive.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--set-sensitive">
<title>gtk.ActionGroup.set_sensitive</title>
<programlisting><methodsynopsis language="python">
<methodname>set_sensitive</methodname>
<methodparam><parameter role="keyword">sensitive</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">sensitive</parameter> :</term>
<listitem><simpara>if <literal>True</literal>, the group is
enabled</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>set_sensitive</methodname>() method sets the
"sensitive" property to the value of
<parameter>sensitive</parameter>. If <parameter>sensitive</parameter>
is <literal>True</literal>, the <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
is enabled.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--get-visible">
<title>gtk.ActionGroup.get_visible</title>
<programlisting><methodsynopsis language="python">
<methodname>get_visible</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the group is
visible.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>get_visible</methodname>() method returns the
value of the "visible" property. If "visible" is <literal>True</literal>,
the group is visible. The constituent actions can only be logically visible
(see the <link
linkend="method-gtkaction--is-visible"><methodname>gtk.Action.is_visible()</methodname></link>
method) if they are visible (see the <link
linkend="method-gtkaction--get-visible"><methodname>gtk.Action.get_visible()</methodname></link>
method) and their group is visible.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--set-visible">
<title>gtk.ActionGroup.set_visible</title>
<programlisting><methodsynopsis language="python">
<methodname>set_visible</methodname>
<methodparam><parameter role="keyword">visible</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">visible</parameter> :</term>
<listitem><simpara>if <literal>True</literal>, the group will be
visible</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>set_visible</methodname>() method sets the
"visible" property to the value of <parameter>visible</parameter>. If
<parameter>visible</parameter> is <literal>True</literal> the <link
linkend="class-gtkactiongroup"><classname>gtk.ActionGroup</classname></link>
will be visible.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--get-action">
<title>gtk.ActionGroup.get_action</title>
<programlisting><methodsynopsis language="python">
<methodname>get_action</methodname>
<methodparam><parameter role="keyword">action_name</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">action_name</parameter> :</term>
<listitem><simpara>the name of the action</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the action, or <literal>None</literal> if no
action with that name exists.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>get_action</methodname>() method retrieves the
action in the action group with the name specified by
<parameter>action_name</parameter>.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--list-actions">
<title>gtk.ActionGroup.list_actions</title>
<programlisting><methodsynopsis language="python">
<methodname>list_actions</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a list of the action objects in the action
group</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>list_action</methodname>() method returns a list
containing the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> objects
in the action group.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--add-action">
<title>gtk.ActionGroup.add_action</title>
<programlisting><methodsynopsis language="python">
<methodname>add_action</methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">action</parameter> :</term>
<listitem><simpara>an action</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>add_action</methodname>() method adds the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> specified
by <parameter>action</parameter> to the action group.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--add-action-with-accel">
<title>gtk.ActionGroup.add_action_with_accel</title>
<programlisting><methodsynopsis language="python">
<methodname>add_action_with_accel</methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
<methodparam><parameter role="keyword">accelerator</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">action</parameter> :</term>
<listitem><simpara>the action to add</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter
role="keyword">accelerator</parameter> :</term>
<listitem><simpara>the accelerator for the action, in the format
understood by the <link
linkend="function-gtk--accelerator-parse"><function>gtk.accelerator_parse</function>()</link>
function, or <literal>None</literal> to use the stock
accelerator</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>add_action_with_accel</methodname>() method adds
a <link linkend="class-gtkaction"><classname>gtk.Action</classname></link>
specified by <parameter>action</parameter> to the action group and sets up
the accelerator specified by <parameter>accelerator</parameter>.</para>
<para>If <parameter>accelerator</parameter> is
<literal>None</literal>, this method attempts to use the accelerator
associated with the "stock_id" property of the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link>.</para>
<para>Accel paths are set to
<literal><Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--remove-action">
<title>gtk.ActionGroup.remove_action</title>
<programlisting><methodsynopsis language="python">
<methodname>remove_action</methodname>
<methodparam><parameter role="keyword">action</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">action</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link></simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>remove_action</methodname>() method removes the
<link linkend="class-gtkaction"><classname>gtk.Action</classname></link>
specified by <parameter>action</parameter> from the action group.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--add-actions">
<title>gtk.ActionGroup.add_actions</title>
<programlisting><methodsynopsis language="python">
<methodname>add_actions</methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">entries</parameter> :</term>
<listitem><simpara>a list or tuple of action
descriptions</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">user_data</parameter> :</term>
<listitem><simpara>data to pass to the action
callbacks</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>add_actions</methodname>() method is a
convenience method that creates a number of <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> objects
based on the information in the list of action entry tuples contained in
<parameter>entries</parameter> and adds them to the action group. The entry
tuples can vary in size from one to six items with the following
information:</para>
<itemizedlist>
<listitem>
<simpara>The name of the action. Must be specified.</simpara>
</listitem>
<listitem>
<simpara>The stock id for the action. Optional with a default
value of <literal>None</literal> if a label is specified.</simpara>
</listitem>
<listitem>
<simpara>The label for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal> if a stock
id is specified.</simpara>
</listitem>
<listitem>
<simpara>The accelerator for the action, in the format understood by
the <link
linkend="function-gtk--accelerator-parse"><function>gtk.accelerator_parse</function>()</link>
function. Optional with a default value of
<literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The tooltip for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The callback function invoked when the action is
activated. Optional with a default value of
<literal>None</literal>.</simpara>
</listitem>
</itemizedlist>
<para>The "activate" signals of the actions are connected to the
callbacks and their accel paths are set to
<literal><Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--add-toggle-actions">
<title>gtk.ActionGroup.add_toggle_actions</title>
<programlisting><methodsynopsis language="python">
<methodname>add_toggle_actions</methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">entries</parameter> :</term>
<listitem><simpara>a list or tuple of toggle action entry
tuples</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">user_data</parameter> :</term>
<listitem><simpara>data to pass to the action
callbacks</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>add_toggle_actions</methodname>() method is a
convenience method that creates a number of <link
linkend="class-gtktoggleaction"><classname>gtk.ToggleAction</classname></link>
objects based on the information in the list of action entry tuples
contained in <parameter>entries</parameter> and adds them to the action
group. The toggle action entry tuples can vary in size from one to seven items
with the following information:</para>
<itemizedlist>
<listitem>
<simpara>The name of the action. Must be specified.</simpara>
</listitem>
<listitem>
<simpara>The stock id for the action. Optional with a default
value of <literal>None</literal> if a label is specified.</simpara>
</listitem>
<listitem>
<simpara>The label for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal> if a stock
id is specified.</simpara>
</listitem>
<listitem>
<simpara>The accelerator for the action, in the format understood by
the <link
linkend="function-gtk--accelerator-parse"><function>gtk.accelerator_parse</function>()</link>
function. Optional with a default value of
<literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The tooltip for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The callback function invoked when the action is
activated. Optional with a default value of
<literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>A flag indicating whether the toggle action is
active. Optional with a default value of <literal>False</literal>.</simpara>
</listitem>
</itemizedlist>
<para>The "activate" signals of the actions are connected to the
callbacks and their accel paths are set to
<literal><Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--add-radio-actions">
<title>gtk.ActionGroup.add_radio_actions</title>
<programlisting><methodsynopsis language="python">
<methodname>add_radio_actions</methodname>
<methodparam><parameter role="keyword">entries</parameter></methodparam>
<methodparam><parameter role="keyword">value</parameter><initializer>0</initializer></methodparam>
<methodparam><parameter role="keyword">on_change</parameter><initializer>None</initializer></methodparam>
<methodparam><parameter role="keyword">user_data</parameter><initializer>None</initializer></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">entries</parameter> :</term>
<listitem><simpara>a list or tuple of radio action entry
tuples</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">value</parameter> :</term>
<listitem><simpara>the value of the radio action to set
active</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">on_change</parameter> :</term>
<listitem><simpara>a callback to connect to the "changed" signal
of the first radio action</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">user_data</parameter> :</term>
<listitem><simpara>data to pass to the
<parameter>on_change</parameter> callback</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>add_radio_actions</methodname>() method is a
convenience method that creates a number of <link
linkend="class-gtkradioaction"><classname>gtk.RadioAction</classname></link>
objects based on the information in the list of action entry tuples
contained in <parameter>entries</parameter> and adds them to the action
group. The entry tuples can vary in size from one to six items with the
following information:</para>
<itemizedlist>
<listitem>
<simpara>The name of the action. Must be specified.</simpara>
</listitem>
<listitem>
<simpara>The stock id for the action. Optional with a default
value of <literal>None</literal> if a label is specified.</simpara>
</listitem>
<listitem>
<simpara>The label for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal> if a stock
id is specified.</simpara>
</listitem>
<listitem>
<simpara>The accelerator for the action, in the format understood by
the <link
linkend="function-gtk--accelerator-parse"><function>gtk.accelerator_parse</function>()</link>
function. Optional with a default value of
<literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The tooltip for the action. This field should typically be
marked for translation, see the <link
linkend="method-gtkactiongroup--set-translation-domain"><methodname>set_translation_domain</methodname>()</link>
method. Optional with a default value of <literal>None</literal>.</simpara>
</listitem>
<listitem>
<simpara>The value to set on the radio action. Optional with a
default value of <literal>0</literal>. Should be specified in
applications.</simpara>
</listitem>
</itemizedlist>
<para>The <parameter>value</parameter> parameter specifies the radio
action that should be set active. The "changed" signal of the first radio
action is connected to the <parameter>on_change</parameter> callback (if
specified and not <literal>None</literal>) and the accel paths of the
actions are set to
<literal><Actions>/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--set-translation-domain">
<title>gtk.ActionGroup.set_translation_domain</title>
<programlisting><methodsynopsis language="python">
<methodname>set_translation_domain</methodname>
<methodparam><parameter role="keyword">domain</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">domain</parameter> :</term>
<listitem><simpara>the translation domain to use for
<methodname>dgettext()</methodname> calls</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>set_translation_domain</methodname>() method
sets the translation domain to the string specified by
<parameter>domain</parameter> and uses <methodname>dgettext()</methodname>
for translating the <parameter>label</parameter> and
<parameter>tooltip</parameter> strings of the actions added by the <link
linkend="method-gtkactiongroup--add-actions"><methodname>add_actions</methodname>()</link>,
<link
linkend="method-gtkactiongroup--add-toggle-actions"><methodname>add_toggle_actions</methodname>()</link>
and <link
linkend="method-gtkactiongroup--add-radio-actions"><methodname>add_radio_actions</methodname>()</link>
methods.</para>
</refsect2>
<refsect2 id="method-gtkactiongroup--translate-string">
<title>gtk.ActionGroup.translate_string</title>
<programlisting><methodsynopsis language="python">
<methodname>translate_string</methodname>
<methodparam><parameter role="keyword">string</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">string</parameter> :</term>
<listitem><simpara>the string to be translated</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the translation of
<parameter>string</parameter></simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.6 and above.</para>
</note>
<para>The <methodname>translate_string</methodname>() method
translates the string specified by <parameter>string</parameter> using the
specified <function>translate_func</function>(). This is mainly intended for
language bindings.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Signals</title>
<refsect2 id="signal-gtkactiongroup--connect-proxy">
<title>The "connect-proxy" gtk.ActionGroup Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>proxy</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>actiongroup</parameter> :</term>
<listitem><simpara>the actiongroup that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>action</parameter> :</term>
<listitem><simpara>the action that is associated with
<parameter>proxy</parameter></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>proxy</parameter> :</term>
<listitem><simpara>the proxy widget associated with
<parameter>action</parameter></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>
<note>
<para>This signal is available in PyGTK 2.4 and above.</para>
</note>
<para>The "connect-proxy" signal is emitted when the widget specified
by <parameter>proxy</parameter> is connected to the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> specified
by <parameter>action</parameter>.</para>
</refsect2>
<refsect2 id="signal-gtkactiongroup--disconnect-proxy">
<title>The "disconnect-proxy" gtk.ActionGroup Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>proxy</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>actiongroup</parameter> :</term>
<listitem><simpara>the actiongroup that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>action</parameter> :</term>
<listitem><simpara>the action that is associated with
<parameter>proxy</parameter></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>proxy</parameter> :</term>
<listitem><simpara>the proxy widget associated with
<parameter>action</parameter></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>
<note>
<para>This signal is available in PyGTK 2.4 and above.</para>
</note>
<para>The "disconnect-proxy" signal is emitted when the widget
specified by <parameter>proxy</parameter> is disconnected from the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> specified
by <parameter>action</parameter>.</para>
</refsect2>
<refsect2 id="signal-gtkactiongroup--post-activate">
<title>The "post-activate" gtk.ActionGroup Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>actiongroup</parameter> :</term>
<listitem><simpara>the actiongroup that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>action</parameter> :</term>
<listitem><simpara>the action that is being
activated</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>
<note>
<para>This signal is available in PyGTK 2.4 and above.</para>
</note>
<para>The "post-activate" signal is emitted after the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> specified
by <parameter>action</parameter> has been activated.</para>
</refsect2>
<refsect2 id="signal-gtkactiongroup--pre-activate">
<title>The "pre-activate" gtk.ActionGroup Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>actiongroup</parameter></methodparam>
<methodparam><parameter>action</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>actiongroup</parameter> :</term>
<listitem><simpara>the actiongroup that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>action</parameter> :</term>
<listitem><simpara>the action that is being
activated</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>
<note>
<para>This signal is available in PyGTK 2.4 and above.</para>
</note>
<para>The "pre-activate" signal is emitted before the <link
linkend="class-gtkaction"><classname>gtk.Action</classname></link> specified
by <parameter>action</parameter> is activated.</para>
</refsect2>
</refsect1>
</refentry>
|