Gtk.CheckMenuItem
Gtk.CheckMenuItem — A menu item with a check box
Object Hierarchy:
GObject
╰── GInitiallyUnowned
╰── Gtk.Widget
╰── Gtk.Container
╰── Gtk.Bin
╰── Gtk.MenuItem
╰── Gtk.CheckMenuItem
╰── Gtk.RadioMenuItem
Functions:
- new
() -> Gtk.Widget
- new_with_label
(label:str) -> Gtk.Widget
- new_with_mnemonic
(label:str) -> Gtk.Widget
- get_active
(self) -> bool
- set_active
(self, is_active:bool)
- toggled
(self)
- get_inconsistent
(self) -> bool
- set_inconsistent
(self, setting:bool)
- set_draw_as_radio
(self, draw_as_radio:bool)
- get_draw_as_radio
(self) -> bool
Signals:
- “toggled”
(checkmenuitem, user_data)
Description:
A Gtk.CheckMenuItem
is a menu item that maintains the state of a boolean value in addition to a Gtk.MenuItem 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.
Function Details:
new()
new () -> Gtk.Widget
Creates a new Gtk.CheckMenuItem
.
- Returns:
a new
Gtk.CheckMenuItem
.
new_with_label()
new_with_label (label:str) -> Gtk.Widget
Creates a new Gtk.CheckMenuItem
with a label.
- Returns:
a new
Gtk.CheckMenuItem
.
new_with_mnemonic()
new_with_mnemonic (label:str) -> Gtk.Widget
Creates a new Gtk.CheckMenuItem
containing a label. The labelwill be created using `Gtk.Label:new_with_mnemonic
(), so underscoresin
label` indicate the mnemonic for the menu item.
- Returns: a new Gtk.CheckMenuItem
get_active()
get_active (self) -> bool
Returns whether the check menu item is active. SeeGtk.CheckMenuItem:set_active()
.
- Returns:
True
if the menu item is checked.
set_active()
set_active (self, is_active:bool)
Sets the active state of the menu item’s check box.
toggled()
toggled (self)
Emits the “toggled” signal.
get_inconsistent()
get_inconsistent (self) -> bool
Retrieves the value set by Gtk.CheckMenuItem:set_inconsistent()
.
- Returns:
True
if inconsistent
set_inconsistent()
set_inconsistent (self, setting:bool)
If the user has selected a range of elements (such as some text orspreadsheet cells) that are affected by a boolean setting, and thecurrent values in that range are inconsistent, you may want todisplay the check in an “in between” state. This function turns on“in between” display. Normally you would turn off the inconsistentstate again if the user explicitly selects a setting. This has to bedone manually, Gtk.CheckMenuItem:set_inconsistent()
only affectsvisual appearance, it doesn’t affect the semantics of the widget.
set_draw_as_radio()
set_draw_as_radio (self, draw_as_radio:bool)
Sets whether check_menu_item
is drawn like a Gtk.RadioMenuItem
- Since: 2.4
get_draw_as_radio()
get_draw_as_radio (self) -> bool
Returns whether check_menu_item
looks like a Gtk.RadioMenuItem
Returns: Whether
check_menu_item
looks like a Gtk.RadioMenuItemSince: 2.4