Package: gtk
Class gtk:switch
Superclassesgtk:widget, gtk:buildable, gtk:actionable, gtk:activatable, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:switch widget is a widget that has two states: on or off. ![]() Figure: GtkSwitch The user can control which state should be active by clicking the switch, or by dragging the handle. CSS nodesswitch ╰── sliderThe gtk:switch implementation has two CSS nodes, the main node with the name switch and a subnode named slider. Neither of them is using any style classes. Style Property Detailsslider-height The slider-height style property of type :int (Read) The minimum height of the switch handle, in pixels. Warning: The slider-height style property has been deprecated since version 3.20 and should not be used in newly written code. Use the CSS min-height property instead. Allowed values: >= 22 Default value: 22 slider-width The slider-width style property of type :int (Read) The minimum width of the switch handle, in pixels. Warning: The slider-width style property has been deprecated since version 3.20 and should not be used in newly written code. Use the CSS min-height property instead. Allowed values: >= 36 Default value: 36 Signal DetailsThe "activate" signallambda (widget) :action
The "state-set" signallambda (widget state) :run-last
To implement delayed state change, applications can connect to this signal, initiate the change of the underlying state, and call the gtk:switch-state function 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 active property is represented by the position of the switch. | Returned bySlot Access FunctionsInherited Slot Access Functions |
#2025-07-14