gtk.CheckMenuItem — a menu item with a check box.
class gtk.CheckMenuItem(gtk.MenuItem): |
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Item +-- gtk.MenuItem +-- gtk.CheckMenuItem
|
gtk.Container Signal Prototypes
gtk.MenuItem Signal Prototypes
"toggled" | def callback( |
A gtk.CheckMenuItem
is a menu item that maintains the state of a boolean value in addition to a
gtk.MenuItem
's
usual role in activating application code. A check box indicating the state
of the boolean value is displayed at the left side of the gtk.MenuItem
.
Activating the gtk.MenuItem
toggles the value.
gtk.CheckMenuItem(label
=None, use_underline
=True)
| a string to be used as the label text or
None |
| if True , 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. |
Returns : | a new checkmenuitem |
Creates a new checkmenuitem with a text label specified by
label
. If label
is
None
or not specified then no label is created. If
label
contains underscore characters then the
character following the underscore will be underlined and the character
following the first underscore will be used as the mnemonic keyboard
accelerator.
In PyGTK 2.4 and above the use_underline
parameter is available and defaults to True
. If
use_underline
is set to False
the
label text will not be parsed for mnemonic characters.
def set_active(is_active
)
| If True set the check box active |
The set_active
() method sets the active
state of the menu item's check box according to the value of
is_active
.
def get_active()
Returns : | True if the menu item is
checked (check box is active). |
The get_active
() method returns whether
the check menu item is active. See gtk.CheckMenuItem.set_active()
.
def toggled()
The toggle() method emits the "toggled" signal on the checkmenuitem
def set_inconsistent(setting
)
| If True display an
"inconsistent" third state check |
The set_inconsistent
() method sets the
check box to display an "inconsistent" state if the value of
setting
is True
. The
"inconsistent" state display is removed if setting
is
False
.
An application may want to display an "inconsistent" state if
the user has selected a range of elements (such as some text or spreadsheet
cells) that are affected by a boolean setting, and the current values for
those elements cannot be represented by a single checkmenuitem state. The
set_inconsistent
() method only affects visual
appearance, it doesn't affect the semantics of the widget.
def get_inconsistent()
Returns : | True if the checkmenuitem
displays the "inconsistent" state |
The get_inconsistent
() method retrieves
the value set by the set_inconsistent()
method.
def set_draw_as_radio(draw_as_radio
)
| If True display the check
menu item like a radio menu item |
This method is available in PyGTK 2.4 and above.
The set_draw_as_radio
() method displays
the check menu item like a radio menu item if the value of
draw_as_radio
is True
. If
draw_as_radio
is False
the check
menu item is displayed as normal.
def get_draw_as_radio()
Returns : | True if the checkmenuitem
should be displayed like a radio menu item. |
This method is available in PyGTK 2.4 and above.
The get_draw_as_radio
() method
retrieves the value set by the set_draw_as_radio()
method.
def callback(checkmenuitem
, user_param1
, ...
)
| the checkmenuitem that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "toggled" signal is emitted when the checkmenuitem changes state.