Gtk.Switch::state-set
Description: Reference for signal Gtk.Switch::state-set

### Signal

# Gtk Switch::state-set

#### Declaration

    gboolean
    state_set (
      GtkSwitch* self,
      gboolean state,
      gpointer user_data
    )

#### Description [src]

Emitted to change the underlying state.

The ::state-set signal is emitted when the user changes the switch position. The default handler keeps the state in sync with the `GtkSwitch:active` property.

To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call `gtk_switch_set_state()` when the underlying state change is complete. The signal handler should return `TRUE` to prevent the default handler from running.

Visually, the underlying state is represented by the trough color of the switch, while the `GtkSwitch:active` property is represented by the position of the switch.

Default handler: | The default handler is called after the handlers added via `g_signal_connect()`.

#### Parameters

`state`

  Type: `gboolean`

  The new state of the switch.

#### Return value

Type: `gboolean`

`TRUE` to stop the signal emission.