Every Add* call returns a handle. That’s how you interact with the control after creating it. Call methods with : syntax (handle:GetValue()).
Everything here works on every control. The per-widget pages only document extras.
Properties
Full save name when the widget was created with a non-nil key; otherwise nil.
Value
Most controls have one main value (a boolean on Toggle, a number on Slider, …). Use GetValue, SetValue, and OnChange for that. Button and a few others don’t, so use their own callbacks instead.
GetValue
Read the control’s current value.
SetValue
handle:SetValue(value: any): ()
Change the control’s value. Single argument only.
Must match the widget’s value type.
OnChange
handle:OnChange(callback: (value: any) -> ()): () -> ()
Run cb(newValue) every time the value changes: user edits, SetValue, SetState.
A function you call to stop listening.
local stop = handle:OnChange(function(v) print(v) end)
stop() -- no longer listening
GetText / SetText
handle:GetText(): string
handle:SetText(text: string): ()
Read or change the control’s label.
Get / Set
handle:Get(field: string): any
handle:Set(field: string, value: any): ()
Read or change other properties on the control (e.g. "formattedValue" on a Slider).
Watch
handle:Watch(field: string, callback: (value: any) -> ()): () -> ()
Listen for changes to a specific property. Returns an unsubscribe function.
Has
handle:Has(field: string): boolean
Check whether the control has a given property.
SetVisible / IsVisible / OnVisibleChange
handle:SetVisible(visible: boolean): ElementHandle
handle:IsVisible(): boolean
handle:OnVisibleChange(callback: (visible: boolean) -> ()): () -> ()
Show or hide the row. SetVisible returns self for chaining.
SetTip
handle:SetTip(tip: string | { title: string?, body: string? }? | nil): ElementHandle
Hover tooltip. Pass nil to remove.
A string, or { title?, body? } for a two-part tooltip.
OverrideValue
handle:OverrideValue(value: any, priority: number?): OverrideHandle
Force the control’s value without changing what the UI shows. See Overrides.
Highest priority wins when multiple scripts override the same control.
Released automatically on script unload.
IsOverridden
handle:IsOverridden(): boolean
True while any override is active on this control.
Destroy
Remove the control from the UI.
Exists
true if the control still exists in the menu.
Other methods
If you call a method that isn’t listed here, it’s passed through to the control itself. See the per-widget pages.