Syntax
ImGuiWindow.destroy(window: ImGuiWindow)Arguments
| Name | Type | Description |
|---|---|---|
window | ImGuiWindow | ImGuiWindow object returned by imgui.create. Non-ImGuiWindow values raise a Lua error. |
Description
Destroys an ImGuiWindow. If the object still points to a window, the method removes that window from Real's tracked ImGui window list, unreferences stored element callbacks, deletes the window record, and sets the Instance reference to nil. Calling destroy again on the same object returns without doing anything.
Call it with 1 parameter(s): window. The argument table explains which values are required and which ones only refine the behavior.
It does not return data. Treat the call as an action and handle errors around the call site when needed.
Example
Example call with placeholder values.
ImGuiWindow.destroy(nil)Types
ImGuiWindow
Handle returned by imgui.create. Control-building methods return the same handle so calls can be chained.
Button (label: string, onClick: () -> ()) -> ImGuiWindow Appends a button and queues the callback with no arguments after a click.Checkbox (label: string, checked: any, onChange: (boolean) -> ()) -> ImGuiWindow Appends a checkbox initialized from the checked value.CollapsingHeader (label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow Immediately runs content to append elements that render under a collapsible header.ColorPicker (label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow Appends a ColorEdit4-backed RGBA editor; onChange is read from argument 7.InputText (label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow Appends a single-line InputText using a fixed 256-byte buffer; onChange is argument 4.SameLine () -> ImGuiWindow Appends a SameLine layout marker that calls same-line layout during rendering.Separator () -> ImGuiWindow Appends a Separator marker that calls a separator during rendering.SliderFloat (label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow Appends a SliderFloat element and queues onChange with one Lua number when the value changes.SliderInt (label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow Appends a SliderInt element and queues onChange with one Lua number when the integer value changes.Text (text: string) -> ImGuiWindow Appends a non-interactive text element.destroy () -> () Removes the window and releases its registered callbacks.