GTK+ 2 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Style Properties | Signals |
#include <gtk/gtk.h> struct GtkCheckMenuItem; GtkWidget * gtk_check_menu_item_new (void
); GtkWidget * gtk_check_menu_item_new_with_label (const gchar *label
); GtkWidget * gtk_check_menu_item_new_with_mnemonic (const gchar *label
); #define gtk_check_menu_item_set_state gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item
); void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item
,gboolean is_active
); void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item
,gboolean always
); void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item
); gboolean gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item
); void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item
,gboolean setting
); void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item
,gboolean draw_as_radio
); gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item
);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkItem +----GtkMenuItem +----GtkCheckMenuItem +----GtkRadioMenuItem
GtkCheckMenuItem implements AtkImplementorIface, GtkBuildable and GtkActivatable.
"active" gboolean : Read / Write "draw-as-radio" gboolean : Read / Write "inconsistent" gboolean : Read / Write
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.
struct GtkCheckMenuItem;
The GtkCheckMenuItem struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.)
guint active; | TRUE if the check box is active. |
GtkWidget * gtk_check_menu_item_new (void
);
Creates a new GtkCheckMenuItem.
Returns : |
a new GtkCheckMenuItem. |
GtkWidget * gtk_check_menu_item_new_with_label (const gchar *label
);
Creates a new GtkCheckMenuItem with a label.
|
the string to use for the label. |
Returns : |
a new GtkCheckMenuItem. |
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.
|
The text of the button, with an underscore in front of the mnemonic character |
Returns : |
a new GtkCheckMenuItem |
#define gtk_check_menu_item_set_state gtk_check_menu_item_set_active
gtk_check_menu_item_set_state
is deprecated and should not be used in newly-written code. Use gtk_check_menu_item_set_active()
instead.
Sets the active state of the menu item's check box.
gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item
);
Returns whether the check menu item is active. See
gtk_check_menu_item_set_active()
.
|
a GtkCheckMenuItem |
Returns : |
TRUE if the menu item is checked. |
void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item
,gboolean is_active
);
Sets the active state of the menu item's check box.
|
a GtkCheckMenuItem. |
|
boolean value indicating whether the check box is active. |
void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item
,gboolean always
);
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.
|
a GtkCheckMenuItem. |
|
boolean value indicating whether to always show the check box. |
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item
);
Emits the GtkCheckMenuItem::toggled signal.
|
a GtkCheckMenuItem. |
gboolean gtk_check_menu_item_get_inconsistent
(GtkCheckMenuItem *check_menu_item
);
Retrieves the value set by gtk_check_menu_item_set_inconsistent()
.
|
a GtkCheckMenuItem |
Returns : |
TRUE if inconsistent |
void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item
,gboolean setting
);
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.
|
a GtkCheckMenuItem |
|
TRUE to display an "inconsistent" third state check |
void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item
,gboolean draw_as_radio
);
Sets whether check_menu_item
is drawn like a GtkRadioMenuItem
|
a GtkCheckMenuItem |
|
whether check_menu_item is drawn like a GtkRadioMenuItem
|
Since 2.4
gboolean gtk_check_menu_item_get_draw_as_radio
(GtkCheckMenuItem *check_menu_item
);
Returns whether check_menu_item
looks like a GtkRadioMenuItem
|
a GtkCheckMenuItem |
Returns : |
Whether check_menu_item looks like a GtkRadioMenuItem
|
Since 2.4
"active"
property"active" gboolean : Read / Write
Whether the menu item is checked.
Default value: FALSE
"draw-as-radio"
property"draw-as-radio" gboolean : Read / Write
Whether the menu item looks like a radio menu item.
Default value: FALSE
"inconsistent"
property"inconsistent" gboolean : Read / Write
Whether to display an "inconsistent" state.
Default value: FALSE
"indicator-size"
style property"indicator-size" gint : Read
Size of check or radio indicator.
Allowed values: >= 0
Default value: 13
"toggled"
signalvoid user_function (GtkCheckMenuItem *checkmenuitem,
gpointer user_data) : Run First
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.
|
the object which received the signal. |
|
user data set when the signal handler was connected. |