Skip to main content

Type Alias: GtkSwitchProps

GtkSwitchProps = WidgetProps & object

Defined in: generated/jsx.ts:9247

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:9261
actionTarget?GLib.VariantThe target value of the actionable widget's action.generated/jsx.ts:9263
active?booleanWhether the GtkSwitch widget is in its on or off state.generated/jsx.ts:9249
onActivate()?(self) => void | nullEmitted to animate the switch. Applications should never connect to this signal, but use the Switch.active property.generated/jsx.ts:9270
onNotify?(self, propName) => void | nullCalled when any property on this widget changes. Param The widget that emitted the notification Param The name of the property that changed (in kebab-case)generated/jsx.ts:9290
onStateSet()?(self, state) => 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:9284
ref?Ref<Gtk.Switch>-generated/jsx.ts:9291
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:9259