MCPcopy Create free account
hub / github.com/cogentcore/core / Switch

Struct Switch

core/switch.go:26–44  ·  view source on GitHub ↗

Switch is a widget that can toggle between an on and off state. It can be displayed as a switch, chip, checkbox, radio button, or segmented button.

Source from the content-addressed store, hash-verified

24// It can be displayed as a switch, chip, checkbox, radio button,
25// or segmented button.
26type Switch struct {
27 Frame
28
29 // Type is the styling type of switch.
30 // It must be set using [Switch.SetType].
31 Type SwitchTypes `set:"-"`
32
33 // Text is the optional text of the switch.
34 Text string
35
36 // IconOn is the icon to use for the on, checked state of the switch.
37 IconOn icons.Icon
38
39 // Iconoff is the icon to use for the off, unchecked state of the switch.
40 IconOff icons.Icon
41
42 // IconIndeterminate is the icon to use for the indeterminate (unknown) state.
43 IconIndeterminate icons.Icon
44}
45
46// SwitchTypes contains the different types of [Switch]es.
47type SwitchTypes int32 //enums:enum -trim-prefix Switch -transform kebab

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected