Gtk.CheckMenuItem¶
| Subclasses: | Gtk.RadioMenuItem | 
|---|
Methods¶
| class | new() | 
| class | new_with_label(label) | 
| class | new_with_mnemonic(label) | 
| get_active() | |
| get_draw_as_radio() | |
| get_inconsistent() | |
| set_active(is_active) | |
| set_draw_as_radio(draw_as_radio) | |
| set_inconsistent(setting) | |
| toggled() | 
Virtual Methods¶
| Inherited: | Gtk.MenuItem (8), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2) | 
|---|
| do_draw_indicator(cr) | |
| do_toggled() | 
Properties¶
| Inherited: | Gtk.MenuItem (5), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| active | bool | r/w/en | Whether the menu item is checked | 
| draw-as-radio | bool | r/w/en | Whether the menu item looks like a radio menu item | 
| inconsistent | bool | r/w/en | Whether to display an “inconsistent” state | 
Style Properties¶
| Inherited: | Gtk.MenuItem (6), Gtk.Widget (17) | 
|---|
| Name | Type | Default | Flags | Short Description | 
|---|---|---|---|---|
| indicator-size | int | 16 | d/r | Size of check or radio indicator deprecated | 
Signals¶
| Inherited: | Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| toggled | This signal is emitted when the state of the check box is changed. | 
Fields¶
| Inherited: | Gtk.MenuItem (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| menu_item | Gtk.MenuItem | r | 
Class Details¶
- 
class Gtk.CheckMenuItem(*args, **kwargs)¶
- Bases: - Gtk.MenuItem- Abstract: - No - Structure: - Gtk.CheckMenuItemClass- A - Gtk.CheckMenuItemis a menu item that maintains the state of a boolean value in addition to a- Gtk.MenuItemusual 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.MenuItemtoggles the value.- CSS nodes
 - menuitem ├── check.left ╰── <child> - Gtk.CheckMenuItemhas a main CSS node with name menuitem, and a subnode with name check, which gets the .left or .right style class.- 
classmethod new()[source]¶
- Returns: - a new - Gtk.CheckMenuItem.- Return type: - Gtk.Widget- Creates a new - Gtk.CheckMenuItem.
 - 
classmethod new_with_label(label)[source]¶
- Parameters: - label ( - str) – the string to use for the label.- Returns: - a new - Gtk.CheckMenuItem.- Return type: - Gtk.Widget- Creates a new - Gtk.CheckMenuItemwith a label.
 - 
classmethod new_with_mnemonic(label)[source]¶
- Parameters: - label ( - str) – The text of the button, with an underscore in front of the character- Returns: - a new - Gtk.CheckMenuItem- Return type: - Gtk.Widget- Creates a new - Gtk.CheckMenuItemcontaining a label. The label will be created using- Gtk.Label.new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.
 - 
get_active()[source]¶
- Returns: - Trueif the menu item is checked.- Return type: - bool- Returns whether the check menu item is active. See - Gtk.CheckMenuItem.set_active().
 - 
get_draw_as_radio()[source]¶
- Returns: - Whether self looks like a - Gtk.RadioMenuItem- Return type: - bool- Returns whether self looks like a - Gtk.RadioMenuItem- New in version 2.4. 
 - 
get_inconsistent()[source]¶
- Returns: - Trueif inconsistent- Return type: - bool- Retrieves the value set by - Gtk.CheckMenuItem.set_inconsistent().
 - 
set_active(is_active)[source]¶
- Parameters: - is_active ( - bool) – boolean value indicating whether the check box is active.- Sets the active state of the menu item’s check box. 
 - 
set_draw_as_radio(draw_as_radio)[source]¶
- Parameters: - draw_as_radio ( - bool) – whether self is drawn like a- Gtk.RadioMenuItem- Sets whether self is drawn like a - Gtk.RadioMenuItem- New in version 2.4. 
 - 
set_inconsistent(setting)[source]¶
- Parameters: - setting ( - bool) –- Trueto display an “inconsistent” third state check- 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 in that range are inconsistent, you may want to display the check in an “in between” state. This function turns on “in between” display. Normally you would turn off the inconsistent state again if the user explicitly selects a setting. This has to be done manually, - Gtk.CheckMenuItem.set_inconsistent() only affects visual appearance, it doesn’t affect the semantics of the widget.
 - 
toggled()[source]¶
- Emits the - Gtk.CheckMenuItem- ::toggledsignal.
 - 
do_draw_indicator(cr) virtual¶
- Parameters: - cr ( - cairo.Context) –
 - 
do_toggled() virtual¶
- Emits the - Gtk.CheckMenuItem- ::toggledsignal.
 
Signal Details¶
- 
Gtk.CheckMenuItem.signals.toggled(check_menu_item)¶
- Signal Name: - toggled- Flags: - RUN_FIRST- Parameters: - check_menu_item ( - Gtk.CheckMenuItem) – The object which received the signal- This signal is emitted when the state of the check box is changed. - A signal handler can use - Gtk.CheckMenuItem.get_active() to discover the new state.
Property Details¶
- 
Gtk.CheckMenuItem.props.active¶
- Name: - active- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- Whether the menu item is checked