> ## 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
  ```

  ## Đối số

  <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>

  ## Giá trị trả về

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

  ## Kiểu

  ### ImGuiWindow

  Xử lý được trả về bởi imgui.create. Các phương pháp xây dựng điều khiển trả về cùng một thẻ điều khiển để các cuộc gọi có thể được xâu chuỗi.

  | Name               | Type                                                                                                                                            | Required | Mô tả                                                                                       |
  | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- |
  | `Button`           | `(label: string, onClick: () -> ()) -> ImGuiWindow`                                                                                             | Yes      | Nối thêm một nút và gọi lại lệnh gọi lại sau một cú nhấp chuột.                             |
  | `Checkbox`         | `(label: string, checked: any, onChange: (boolean) -> ()) -> ImGuiWindow`                                                                       | Yes      | Nối một hộp kiểm được khởi tạo vào trạng thái được cung cấp.                                |
  | `CollapsingHeader` | `(label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow`                                                                                  | Yes      | Các điều khiển nhóm được thêm vào bởi lệnh gọi lại nội dung bên dưới tiêu đề thu gọn.       |
  | `ColorPicker`      | `(label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow` | Yes      | Nối thêm trình soạn thảo RGBA; các thành phần màu bị bỏ qua mặc định là 1.0.                |
  | `InputText`        | `(label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow`                                                                       | Yes      | Nối thêm kiểu nhập văn bản một dòng; văn bản ban đầu bị bỏ qua mặc định là một chuỗi trống. |
  | `SameLine`         | `() -> ImGuiWindow`                                                                                                                             | Yes      | Đặt điều khiển tiếp theo trên cùng một dòng.                                                |
  | `Separator`        | `() -> ImGuiWindow`                                                                                                                             | Yes      | Nối thêm một dấu phân cách ngang.                                                           |
  | `SliderFloat`      | `(label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow`                                     | Yes      | Nối thêm một thanh trượt dấu phẩy động.                                                     |
  | `SliderInt`        | `(label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow`                                  | Yes      | Nối thêm một thanh trượt số nguyên.                                                         |
  | `Text`             | `(text: string) -> ImGuiWindow`                                                                                                                 | Yes      | Nối thêm văn bản không tương tác.                                                           |
  | `destroy`          | `() -> ()`                                                                                                                                      | Yes      | Xóa cửa sổ và giải phóng các cuộc gọi lại đã đăng ký của nó.                                |
</div>
