struct Gtk::Switch::StateSetSignal

Overview

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 Gtk::Switch#active property.

To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call Gtk::Switch#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 Gtk::Switch#active property is represented by the position of the switch.

Defined in:

auto/gtk-4.0/switch.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(source, detail = nil) #

Instance Method Detail

def [](detail : String) : self #

def connect(&block : Proc(Bool, Bool)) #

def connect(handler : Proc(Bool, Bool)) #

def connect(handler : Proc(Gtk::Switch, Bool, Bool)) #

def connect_after(&block : Proc(Bool, Bool)) #

def connect_after(handler : Proc(Bool, Bool)) #

def connect_after(handler : Proc(Gtk::Switch, Bool, Bool)) #

def emit(state : Bool) : Nil #

def name #