cheatgui
    Preparing search index...

    Class ToggleWidget

    A class that represents a toggle that can be turned on and off.

    @ extends Widget implements ValueWidget

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Create a new toggle.

      Parameters

      • Optionallabel: string = ''

        The label text.

      • Optionalchecked: boolean = false

        Whether the toggle is initially checked.

      • Optionalcallback: ((value: boolean) => void) | null = null

        The callback function to call when the toggle is changed.

      Returns ToggleWidget

    Properties

    id: string
    inputRef: HTMLInputElement
    labelRef: HTMLSpanElement
    listeners: { [key: string]: EventCallback[] }
    ref: HTMLLabelElement
    sliderRef: HTMLSpanElement
    view: View

    Methods

    • Bind a property to the toggle.

      Parameters

      • obj: any

        The object to bind the property to.

      • prop: string

        The property to bind.

      Returns this

    • Set the callback function to call when the toggle is changed.

      Parameters

      • func: (value: boolean) => void

        The callback function to call when the toggle is changed.

      Returns this