Skip to main content

Type Alias: GtkSwitchProps

GtkSwitchProps = WidgetProps & object

Defined in: generated/jsx.ts:7440

Props for the GtkSwitch widget.

Type Declaration

NameTypeDescriptionDefined in
actionName?stringThe name of the action with which this widget should be associated.generated/jsx.ts:7454
actionTarget?GLib.VariantThe target value of the actionable widget's action.generated/jsx.ts:7456
active?booleanWhether the GtkSwitch widget is in its on or off state.generated/jsx.ts:7442
onActivate?(self) => void | nullEmitted to animate the switch. Applications should never connect to this signal, but use the Switch.active property.generated/jsx.ts:7463
onStateSet?(state, self) => boolean | nullEmitted to change the underlying state. The ::state-set signal is emitted when the user changes the switch position. The default handler calls Switch.set_state with the value of state. To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call Switch.set_state when the underlying state change is complete. The signal handler should return %TRUE to prevent the default handler from running.generated/jsx.ts:7477
ref?Ref<Gtk.Switch>-generated/jsx.ts:7478
state?booleanThe backend state that is controlled by the switch. Applications should usually set the Switch.active property, except when indicating a change to the backend state which occurs separately from the user's interaction. See Switch.:state-set for details.generated/jsx.ts:7452