Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gtk_switch_new () |
void | gtk_switch_set_active () |
gboolean | gtk_switch_get_active () |
void | gtk_switch_set_state () |
gboolean | gtk_switch_get_state () |
GtkSwitch is a widget that has two states: on or off. The user can control which state should be active by clicking the empty area, or by dragging the handle.
GtkSwitch can also handle situations where the underlying state changes with a delay. See “state-set” for details.
void gtk_switch_set_active (GtkSwitch *sw
,gboolean is_active
);
Changes the state of sw
to the desired one.
Since: 3.0
gboolean
gtk_switch_get_active (GtkSwitch *sw
);
Gets whether the GtkSwitch is in its “on” or “off” state.
Since: 3.0
void gtk_switch_set_state (GtkSwitch *sw
,gboolean state
);
Sets the underlying state of the GtkSwitch.
Normally, this is the same as “active”, unless the switch is set up for delayed state changes. This function is typically called from a “state-set” signal handler.
See “state-set” for details.
Since: 3.14
struct GtkSwitch { };
The GtkSwitch contains private data and it should only be accessed using the provided API.