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
|
<?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-gtkmenuitem">
<refnamediv>
<refname>gtk.MenuItem</refname>
<refpurpose>the widget used for an item in menus</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtk.MenuItem</classname></ooclass>
<ooclass><classname><link
linkend="class-gtkitem">gtk.Item</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link
linkend="constructor-gtkmenuitem">gtk.MenuItem</link></methodname>
<methodparam><parameter
role="keyword">label</parameter><initializer>None</initializer></methodparam>
<methodparam><parameter role="keyword">use_underline</parameter>
<initializer>True</initializer></methodparam>
</constructorsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--set-submenu">set_submenu</link></methodname>
<methodparam><parameter
role="keyword">submenu</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--get-submenu">get_submenu</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--remove-submenu">remove_submenu</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--select">select</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--deselect">deselect</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--activate">activate</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--toggle-size-request">toggle_size_request</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--toggle-size-allocate">toggle_size_allocate</link></methodname>
<methodparam><parameter
role="keyword">allocation</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--set-right-justified">set_right_justified</link></methodname>
<methodparam><parameter
role="keyword">right_justified</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--get-right-justified">get_right_justified</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gtkmenuitem--set-accel-path">set_accel_path</link></methodname>
<methodparam><parameter
role="keyword">accel_path</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkmenuitem--get-accel-path">get_accel_path</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkmenuitem--set-label">set_label</link></methodname>
<methodparam><parameter role="keyword">label</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkmenuitem--get-label">get_label</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkmenuitem--set-use-underline">set_use_underline</link></methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gtkmenuitem--get-use-underline">get_use_underline</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
+-- <link linkend="class-gtkobject">gtk.Object</link>
+-- <link linkend="class-gtkwidget">gtk.Widget</link>
+-- <link linkend="class-gtkcontainer">gtk.Container</link>
+-- <link linkend="class-gtkbin">gtk.Bin</link>
+-- <link linkend="class-gtkitem">gtk.Item</link>
+-- <link linkend="class-gtkmenuitem">gtk.MenuItem</link>
</synopsis>
</refsect1>
<refsect1>
<title>Implemented Interfaces</title>
<para>
<link linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link>
implements
<link linkend="class-gtkbuildable"><classname>gtk.Buildable</classname></link>
<link linkend="class-atkimplementor"><classname>atk.ImplementorIFace</classname></link>
</para>
</refsect1>
<refsect1 id="properties-gtkmenuitem">
<title>gtk.MenuItem Properties</title>
<para><link linkend="properties-gtkobject">gtk.Object Properties</link></para>
<para><link linkend="properties-gtkwidget">gtk.Widget Properties</link></para>
<para><link linkend="properties-gtkcontainer">gtk.Container Properties</link></para>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"accel-path"</entry>
<entry>Read-Write</entry>
<entry>Sets the accelerator path of the menu item, through
which runtime changes of the menu item's accelerator caused
by the user can be identified and saved to persistant storage.
Default value: <literal>None</literal>.
Available in GTK+ 2.14.
</entry>
</row>
<row valign="top">
<entry>"label"</entry>
<entry>Read-Write</entry>
<entry>The text for the child label.
Available in GTK+ 2.16.
</entry>
</row>
<row valign="top">
<entry>"right-justified"</entry>
<entry>Read-Write</entry>
<entry>Sets whether the menu item appears justified at the
right side of a menu bar.
Default value: <literal>False</literal>.
Available in GTK+ 2.14.
</entry>
</row>
<row valign="top">
<entry>"submenu"</entry>
<entry>Read-Write</entry>
<entry>The submenu attached to the menu item, or
<literal>None</literal> if it has none. This
property is available in GTK+ 2.12 and above.</entry>
</row>
<row valign="top">
<entry>"use-underline"</entry>
<entry>Read-Write</entry>
<entry><literal>True</literal> if underlines in the text
indicate mnemonics.
Available in GTK+ 2.16.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="style-properties-gtkmenuitem">
<title>gtk.MenuItem Style Properties</title>
<para><link linkend="style-properties-gtkwidget">gtk.Widget Style Properties</link></para>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"arrow-scaling"</entry>
<entry>Read</entry>
<entry>Amount of space used up by arrow, relative to the menu item's font size.
Allowed values: [0,2].
Default value: 0.8</entry>
</row>
<row valign="top">
<entry>"arrow-spacing"</entry>
<entry>Read</entry>
<entry>Space between label and arrow. Allowed values: >= 0.
Default value: 10</entry>
</row>
<row valign="top">
<entry>"horizontal-padding"</entry>
<entry>Read</entry>
<entry>Padding to left and right of the menu item. Allowed
values: >= 0. Default value: 3</entry>
</row>
<row valign="top">
<entry>"selected-shadow-type"</entry>
<entry>Read</entry>
<entry>The shadow type when the item is selected. Default
value: <literal>gtk.SHADOW_NONE</literal></entry>
</row>
<row valign="top">
<entry>"toggle-spacing"</entry>
<entry>Read</entry>
<entry>Space between icon and label. Allowed values: >= 0.
Default value: 5</entry>
</row>
<row valign="top">
<entry>"width-chars"</entry>
<entry>Read</entry>
<entry>The minimum desired width of the menu item in characters.
Allowed values: >= 0. Default value: 12.
Available in GTK+ 2.14.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1 id="signal-prototypes-gtkmenuitem">
<title>gtk.MenuItem Signal Prototypes</title>
<para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkobject">gtk.Object Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkwidget">gtk.Widget Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkcontainer">gtk.Container Signal Prototypes</link></para>
<para><link linkend="signal-prototypes-gtkitem">gtk.Item Signal Prototypes</link></para>
<variablelist>
<varlistentry>
<term>"<link
linkend="signal-gtkmenuitem--activate">activate</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkmenuitem--activate-item">activate-item</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkmenuitem--toggle-size-allocate">toggle-size-allocate</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter>
</methodparam>
<methodparam><parameter>allocation</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
<varlistentry>
<term>"<link
linkend="signal-gtkmenuitem--toggle-size-request">toggle-size-request</link>"</term>
<listitem>
<methodsynopsis
language="python"><methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter>
</methodparam>
<methodparam><parameter>requisition</parameter>
</methodparam>
<methodparam><parameter>user_param1</parameter>
</methodparam>
<methodparam><parameter>...</parameter>
</methodparam>
</methodsynopsis>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link>
widget implements the appearance and behavior of menu items. The <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link> and
its derived widget subclasses are the only valid children of menus.</para>
<para>When menu items are selected and activated by a user they
can:</para>
<itemizedlist>
<listitem>
<simpara>display a popup menu if they have an associated
submenu</simpara>
</listitem>
<listitem>
<simpara>invoke an associated function or method</simpara>
</listitem>
</itemizedlist>
<para>As a <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link> is a
subclass of <link
linkend="class-gtkbin"><classname>gtk.Bin</classname></link> it can hold any
valid child widget.</para>
</refsect1>
<refsect1 id="constructor-gtkmenuitem">
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname>gtk.MenuItem</methodname>
<methodparam><parameter
role="keyword">label</parameter><initializer>None</initializer></methodparam>
<methodparam><parameter role="keyword">use_underline</parameter>
<initializer>True</initializer></methodparam>
</constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">label</parameter> :</term>
<listitem><simpara>a string to be used as the text of the menu item
or <literal>None</literal></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">use_underline</parameter> :</term>
<listitem><simpara>if <literal>True</literal>, an underscore in the
label text indicates the next character should be underlined and used for the
mnemonic accelerator key if it is the first character so
marked. Available in PyGTK 2.4 and above.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a new <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link>
widget</simpara></listitem>
</varlistentry>
</variablelist>
<para>Creates a new <link
linkend="class-gtkmenuitem"><classname>gtk.MenuItem</classname></link>
widget and sets the text of the menu item label to the value of
<parameter>label</parameter>. If <parameter>label</parameter> is
<literal>None</literal> no label is created for the menu item. The text of
label is parsed for underscore characters that indicate that the next
character is a mnemonic accelerator.</para>
<para>In PyGTK 2.4 and above the <parameter>use_underline</parameter>
parameter is available and defaults to <literal>True</literal>. If
<parameter>use_underline</parameter> is set to <literal>False</literal> the
label text will not be parsed for mnemonic characters.</para>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gtkmenuitem--set-submenu">
<title>gtk.MenuItem.set_submenu</title>
<programlisting><methodsynopsis language="python">
<methodname>set_submenu</methodname>
<methodparam><parameter
role="keyword">submenu</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">submenu</parameter> :</term>
<listitem><simpara>the menu to use as the
submenu</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_submenu</methodname>() method sets the menu
specified by <parameter>submenu</parameter> as the submenu for the menu
item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--get-submenu">
<title>gtk.MenuItem.get_submenu</title>
<programlisting><methodsynopsis language="python">
<methodname>get_submenu</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the submenu for this menu item, or
<literal>None</literal> if there is no submenu.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_submenu</methodname>() method returns the
submenu widget associated with this menu item. If there is no submenu this
method returns <literal>None</literal>. See <link
linkend="method-gtkmenuitem--set-submenu"><methodname>set_submenu</methodname>()</link>.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--remove-submenu">
<title>gtk.MenuItem.remove_submenu</title>
<programlisting><methodsynopsis language="python">
<methodname>remove_submenu</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<para>The <methodname>remove_submenu</methodname>() method removes the
submenu associated with the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--select">
<title>gtk.MenuItem.select</title>
<programlisting><methodsynopsis language="python">
<methodname>select</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<para>The <methodname>select</methodname>() method emits the "select"
signal on the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--deselect">
<title>gtk.MenuItem.deselect</title>
<programlisting><methodsynopsis language="python">
<methodname>deselect</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<para>The <methodname>deselect</methodname>() method emits the
"deselect" signal on the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--activate">
<title>gtk.MenuItem.activate</title>
<programlisting><methodsynopsis language="python">
<methodname>activate</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<para>The <methodname>activate</methodname>() method emits the
"activate" signal on the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--toggle-size-request">
<title>gtk.MenuItem.toggle_size_request</title>
<programlisting><methodsynopsis language="python">
<methodname>toggle_size_request</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the size requisition</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.4 and above.</para>
</note>
<para>The <methodname>toggle_size_request</methodname>() method emits
the "toggle-size-request" signal on the menuitem and returns the size
requested for the menuitem.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--toggle-size-allocate">
<title>gtk.MenuItem.toggle_size_allocate</title>
<programlisting><methodsynopsis language="python">
<methodname>toggle_size_allocate</methodname>
<methodparam><parameter
role="keyword">allocation</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">allocation</parameter> :</term>
<listitem><simpara>the allocation size for the menu
item</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>toggle_size_allocate</methodname>() method emits
the "toggle-size-allocate" signal on the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--set-right-justified">
<title>gtk.MenuItem.set_right_justified</title>
<programlisting><methodsynopsis language="python">
<methodname>set_right_justified</methodname>
<methodparam><parameter
role="keyword">right_justified</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">right_justified</parameter> :</term>
<listitem><simpara>if <literal>True</literal> the menu item will
appear at the far right if added to a menu bar.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_right_justified</methodname>() method sets
the justification of the menu item according to the value of
<parameter>right_justified</parameter>. If
<parameter>right_justified</parameter> is <literal>True</literal> the menu
item will appear at the right side of a menu bar. If the widget layout is
reversed for a right-to-left language like Hebrew or Arabic,
right-justified-menu-items appear on the left.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--get-right-justified">
<title>gtk.MenuItem.get_right_justified</title>
<programlisting><methodsynopsis language="python">
<methodname>get_right_justified</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the menu item will
appear at the far right if added to a menu bar.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_right_justified</methodname>() method gets
the justification of the menu item. If <literal>True</literal> the menu item
appears justified at the right side of the menu bar.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--set-accel-path">
<title>gtk.MenuItem.set_accel_path</title>
<programlisting><methodsynopsis language="python">
<methodname>set_accel_path</methodname>
<methodparam><parameter
role="keyword">accel_path</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">accel_path</parameter> :</term>
<listitem><simpara>the accelerator path, corresponding to this
menu item</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_accel_path</methodname>() method sets the
accelerator path on the menu item. The accelerator path provides access to
the menu item's accelerator allowing user changes to be identified and saved
to persistent storage. See also the <link
linkend="method-gtkmenu--set-accel-path"><methodname>gtk.Menu.set_accel_path</methodname>()</link>
method for a more convenient variant of this function. This method is a
convenience wrapper that handles calling <link
linkend="method-gtkwidget--set-accel-path"><methodname>gtk.Widget.set_accel_path</methodname>()</link>
with the appropriate accelerator group for the menu item.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--get-accel-path">
<title>gtk.MenuItem.get_accel_path</title>
<programlisting><methodsynopsis language="python">
<methodname>get_accel_path</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the accelerator path corresponding to this menu
item's functionality, or <literal>None</literal> if not set </simpara></listitem>
</varlistentry>
</variablelist>
<para>
The <methodname>get_accel_path</methodname>() method gets the accelerator
path that was previously set on menu_item.
</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--set-label">
<title>gtk.MenuItem.set_label</title>
<programlisting><methodsynopsis language="python">
<methodname>set_label</methodname>
<methodparam><parameter role="keyword">label</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">label</parameter> :</term>
<listitem><simpara>the text you want to set.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.16 and above.</para>
</note>
<para>The <methodname>set_label</methodname>() method sets the text
specified by <parameter>label</parameter> on the menu_item label .</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--get-label">
<title>gtk.MenuItem.get_label</title>
<programlisting><methodsynopsis language="python">
<methodname>get_label</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>The text in the menu_item label.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.16 and above.</para>
</note>
<para>The <methodname>get_label</methodname>() method gets the text in the menu_item label.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--set-use-underline">
<title>gtk.MenuItem.set_use_underline</title>
<programlisting><methodsynopsis language="python">
<methodname>set_use_underline</methodname>
<methodparam><parameter role="keyword">setting</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">setting</parameter> :</term>
<listitem><simpara><literal>True</literal> if underlines in the text indicate mnemonics.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.16 and above.</para>
</note>
<para>The <methodname>set_use_underline</methodname>() method gets whether an underline in the text
indicates the next character should be used for the mnemonic accelerator key.</para>
</refsect2>
<refsect2 id="method-gtkmenuitem--get-use-underline">
<title>gtk.MenuItem.get_use_underline</title>
<programlisting><methodsynopsis language="python">
<methodname>get_use_underline</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if an embedded underline in the label indicates the mnemonic accelerator key.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.16 and above.</para>
</note>
<para>The <methodname>get_use_underline</methodname>() method checks if an underline in the text indicates
the next character should be used for the mnemonic accelerator key.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Signals</title>
<refsect2 id="signal-gtkmenuitem--activate">
<title>The "activate" gtk.MenuItem Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>menuitem</parameter> :</term>
<listitem><simpara>the menuitem that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "activate" signal is emitted when the menu item is
activated.</para>
</refsect2>
<refsect2 id="signal-gtkmenuitem--activate-item">
<title>The "activate-item" gtk.MenuItem Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>menuitem</parameter> :</term>
<listitem><simpara>the menuitem that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "activate-item" signal is emitted when the menu item is
activated, but also if the menu item has a submenu. For normal applications,
the relevant signal is "activate".</para>
</refsect2>
<refsect2 id="signal-gtkmenuitem--toggle-size-allocate">
<title>The "toggle-size-allocate" gtk.MenuItem Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter></methodparam>
<methodparam><parameter>allocation</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>menuitem</parameter> :</term>
<listitem><simpara>the menuitem that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>allocation</parameter> :</term>
<listitem><simpara>the size allocation for the
menuitem</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "toggle-size-allocate" signal is emitted when the size
allocation is changed.</para>
</refsect2>
<refsect2 id="signal-gtkmenuitem--toggle-size-request">
<title>The "toggle-size-request" gtk.MenuItem Signal</title>
<programlisting><methodsynopsis language="python">
<methodname>callback</methodname>
<methodparam><parameter>menuitem</parameter></methodparam>
<methodparam><parameter>requisition</parameter></methodparam>
<methodparam><parameter>user_param1</parameter></methodparam>
<methodparam><parameter>...</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter>menuitem</parameter> :</term>
<listitem><simpara>the menuitem that received the
signal</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>requisition</parameter> :</term>
<listitem><simpara>the pointer to the location to put the size
request</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>user_param1</parameter> :</term>
<listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter>...</parameter> :</term>
<listitem><simpara>additional user parameters (if
any)</simpara></listitem>
</varlistentry>
</variablelist>
<para>The "toggle-size-request" signal is emitted when a new size
request is needed.</para>
</refsect2>
</refsect1>
</refentry>
|