Name
GtkCheckMenuItem -- a menu item with a check box.
Description
A GtkCheckMenuItem is a menu item that maintains the state of a boolean
value in addition to a GtkMenuItem'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 GtkMenuItem. Activating the GtkMenuItem
toggles the value.
Details
struct GtkCheckMenuItem
The GtkCheckMenuItem struct contains the following fields.
(These fields should be considered read-only. They should never be set by
an application.)
gtk_check_menu_item_new_with_label ()
Creates a new GtkCheckMenuItem with a label.
gtk_check_menu_item_new_with_mnemonic ()
GtkWidget* gtk_check_menu_item_new_with_mnemonic
(const gchar *label); |
Creates a new GtkCheckMenuItem containing a label. The label
will be created using gtk_label_new_with_mnemonic(), so underscores
in label indicate the mnemonic for the menu item.
gtk_check_menu_item_set_state
#define gtk_check_menu_item_set_state gtk_check_menu_item_set_active
|
Warning |
gtk_check_menu_item_set_state is deprecated and should not be used in newly-written code.
|
This macro is provided to preserve compatibility with older code.
New code should use gtk_check_menu_item_set_active() function instead.
gtk_check_menu_item_set_active ()
Sets the active state of the menu item's check box.
gtk_check_menu_item_set_show_toggle ()
Warning |
gtk_check_menu_item_set_show_toggle is deprecated and should not be used in newly-written code.
|
Controls whether the check box is shown at all times.
Normally the check box is shown only when it is active or while the
menu item is selected.
gtk_check_menu_item_toggled ()
Emits the GtkCheckMenuItem::toggled signal.
gtk_check_menu_item_set_inconsistent ()
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_check_menu_item_set_inconsistent() only affects
visual appearance, it doesn't affect the semantics of the widget.
Properties
- "active" (gboolean : Read / Write)
Whether the menu item is checked.
- "inconsistent" (gboolean : Read / Write)
Whether to display an "inconsistent" state.
Signals
The "toggled" signal
This signal is emitted when the state of the check box is changed.
A signal handler can examine the active
field of the GtkCheckMenuItem struct to discover the new state.