Next: , Previous: GtkRadioMenuItem, Up: Top


62 GtkCheckMenuItem

A menu item with a check box

62.1 Overview

A <gtk-check-menu-item> is a menu item that maintains the state of a boolean value in addition to a <gtk-menu-item>'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-menu-item>. Activating the <gtk-menu-item> toggles the value.

62.2 Usage

— Class: <gtk-check-menu-item>

Derives from <gtk-menu-item>.

This class defines the following slots:

active
Whether the menu item is checked
inconsistent
Whether to display an "inconsistent" state
draw-as-radio
Whether the menu item looks like a radio menu item
— Signal on <gtk-check-menu-item>: toggled

This signal is emitted when the state of the check box is changed.

A signal handler can examine the <gtk-check-menu-item> struct to discover the new state.

— Function: gtk-check-menu-item-new ⇒  (ret <gtk-widget>)

Creates a new <gtk-check-menu-item>.

ret
a new <gtk-check-menu-item>.
— Function: gtk-check-menu-item-new-with-label (label mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-check-menu-item> with a label.

label
the string to use for the label.
ret
a new <gtk-check-menu-item>.
— Function: gtk-check-menu-item-get-active (self <gtk-check-menu-item>) ⇒  (ret bool)
— Method: get-active

Returns whether the check menu item is active. See gtk-check-menu-item-set-active.

check-menu-item
a <gtk-check-menu-item>
ret
#t’ if the menu item is checked.
— Function: gtk-check-menu-item-set-active (self <gtk-check-menu-item>) (is_active bool)
— Method: set-active

Sets the active state of the menu item's check box.

check-menu-item
a <gtk-check-menu-item>.
is-active
boolean value indicating whether the check box is active.
— Function: gtk-check-menu-item-toggled (self <gtk-check-menu-item>)
— Method: toggled

Emits the GtkCheckMenuItem::toggled signal.

check-menu-item
a <gtk-check-menu-item>.