Gtk.Switch

const Gtk = imports.gi.Gtk;

let switch = new Gtk.Switch({
    active: value,
});
  

Gtk.Switch 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.

Hierarchy

  • GObject.Object
    • GObject.InitiallyUnowned
      • Gtk.Widget
        • Gtk.Switch