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.
A Gtk::ToggleButton will remain 'pressed-in' when clicked.
Clicking again will cause the toggle button to return to it's normal state. The state of a Gtk::ToggleButton can be set specifically using set_active(), and retrieved using get_active(). To simply switch the state of a toggle button, use toggled().
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, set_inconsistent() only affects visual appearance, it doesn't affect the semantics of the button.
Parameters:
setting
true if state is inconsistent.
void Gtk::ToggleButton::set_mode
(
bool
draw_indicator = true
)
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 effects instances of classes like Gtk::CheckButton and Gtk::RadioButton that derive from Gtk::ToggleButton, not instances of Gtk::ToggleButton itself.
Parameters:
draw_indicator
If true, draw the button as a separate indicator and label; if false, draw the button like a normal button.