![]() |
![]() |
![]() |
GTK+ 3 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <gtk/gtk.h> GtkToggleButton; GtkWidget* gtk_toggle_button_new (void
); GtkWidget* gtk_toggle_button_new_with_label (const gchar *label
); GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label
); void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button
,gboolean draw_indicator
); gboolean gtk_toggle_button_get_mode (GtkToggleButton *toggle_button
); void gtk_toggle_button_toggled (GtkToggleButton *toggle_button
); gboolean gtk_toggle_button_get_active (GtkToggleButton *toggle_button
); void gtk_toggle_button_set_active (GtkToggleButton *toggle_button
,gboolean is_active
); gboolean gtk_toggle_button_get_inconsistent (GtkToggleButton *toggle_button
); void gtk_toggle_button_set_inconsistent (GtkToggleButton *toggle_button
,gboolean setting
);
GtkWidget* gtk_toggle_button_new_with_label (const gchar *label
);
|
|
Returns : |
GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label
);
Creates a new GtkToggleButton containing a label. The label
will be created using gtk_label_new_with_mnemonic()
, so underscores
in label
indicate the mnemonic for the button.
|
the text of the button, with an underscore in front of the mnemonic character |
Returns : |
a new GtkToggleButton |
void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button
,gboolean draw_indicator
);
Sets whether the button is displayed as a separate indicator and label.
You can call this function on a checkbutton or a radiobutton with
draw_indicator
= FALSE
to make the button look like a normal button
This function only affects instances of classes like GtkCheckButton and GtkRadioButton that derive from GtkToggleButton, not instances of GtkToggleButton itself.
|
a GtkToggleButton |
|
if TRUE , draw the button as a separate indicator
and label; if FALSE , draw the button like a normal button
|
gboolean gtk_toggle_button_get_mode (GtkToggleButton *toggle_button
);
Retrieves whether the button is displayed as a separate indicator
and label. See gtk_toggle_button_set_mode()
.
|
a GtkToggleButton |
Returns : |
TRUE if the togglebutton is drawn as a separate indicator
and label.
|
void gtk_toggle_button_toggled (GtkToggleButton *toggle_button
);
|
gboolean gtk_toggle_button_get_active (GtkToggleButton *toggle_button
);
|
|
Returns : |
void gtk_toggle_button_set_active (GtkToggleButton *toggle_button
,gboolean is_active
);
|
|
|
gboolean gtk_toggle_button_get_inconsistent (GtkToggleButton *toggle_button
);
Gets the value set by gtk_toggle_button_set_inconsistent()
.
|
a GtkToggleButton |
Returns : |
TRUE if the button is displayed as inconsistent, FALSE otherwise
|
void gtk_toggle_button_set_inconsistent (GtkToggleButton *toggle_button
,gboolean setting
);
If the user has selected a range of elements (such as some text or
spreadsheet cells) that are affected by a toggle button, and the
current values in that range are inconsistent, you may want to
display the toggle in an "in between" state. This function turns on
"in between" display. Normally you would turn off the inconsistent
state again if the user toggles the toggle button. This has to be
done manually, gtk_toggle_button_set_inconsistent()
only affects
visual appearance, it doesn't affect the semantics of the button.
|
a GtkToggleButton |
|
TRUE if state is inconsistent
|