> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# ImGuiWindow.Checkbox

> Appends a checkbox element to an ImGuiWindow. The callback is invoked with the new boolean value when the checkbox changes, and the method returns the same ImGuiWindow object.

<div className="real-function-page">
  ```lua theme={null}
  ImGuiWindow.Checkbox(window: ImGuiWindow, label: string, checked: any, onChange: function): ImGuiWindow
  ```

  ## Аргументы

  <ParamField path={"window"} type={"ImGuiWindow"} required>
    ImGuiWindow object returned by imgui.create. A destroyed or invalid window raises a Lua error.
  </ParamField>

  <ParamField path={"label"} type={"string"} required>
    Checkbox label string passed to the rendered ImGui checkbox.
  </ParamField>

  <ParamField path={"checked"} type={"any"} required>
    Initial checked value. nil and false are treated as false; other values are treated as true.
  </ParamField>

  <ParamField path={"onChange"} type={"function"} required>
    Function stored for this checkbox and invoked with the new boolean state after a change event is processed.
  </ParamField>

  ## Возвраты

  <ResponseField name={"window"} type={"ImGuiWindow"}>
    The same ImGuiWindow object, allowing chained method calls.
  </ResponseField>

  ## Типы

  ### ImGuiWindow

  Дескриптор, возвращаемый imgui.create. Методы создания элементов управления возвращают один и тот же дескриптор, поэтому вызовы можно объединять в цепочки.

  | Name               | Type                                                                                                                                            | Required | Описание                                                                                                        |
  | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
  | `Button`           | `(label: string, onClick: () -> ()) -> ImGuiWindow`                                                                                             | Yes      | Добавляет кнопку и вызывает обратный вызов после щелчка.                                                        |
  | `Checkbox`         | `(label: string, checked: any, onChange: (boolean) -> ()) -> ImGuiWindow`                                                                       | Yes      | Добавляет флажок, инициализированный в указанное состояние.                                                     |
  | `CollapsingHeader` | `(label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow`                                                                                  | Yes      | Элементы управления группами, добавляемые обратным вызовом содержимого под сворачивающимся заголовком.          |
  | `ColorPicker`      | `(label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow` | Yes      | Добавляет редактор RGBA; опущенные цветовые компоненты по умолчанию равны 1.0.                                  |
  | `InputText`        | `(label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow`                                                                       | Yes      | Добавляет однострочный текстовый ввод; опущенный начальный текст по умолчанию представляет собой пустую строку. |
  | `SameLine`         | `() -> ImGuiWindow`                                                                                                                             | Yes      | Размещает следующий элемент управления в той же строке.                                                         |
  | `Separator`        | `() -> ImGuiWindow`                                                                                                                             | Yes      | Добавляет горизонтальный разделитель.                                                                           |
  | `SliderFloat`      | `(label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow`                                     | Yes      | Добавляет ползунок с плавающей запятой.                                                                         |
  | `SliderInt`        | `(label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow`                                  | Yes      | Добавляет целочисленный ползунок.                                                                               |
  | `Text`             | `(text: string) -> ImGuiWindow`                                                                                                                 | Yes      | Добавляет неинтерактивный текст.                                                                                |
  | `destroy`          | `() -> ()`                                                                                                                                      | Yes      | Удаляет окно и освобождает зарегистрированные обратные вызовы.                                                  |
</div>
