Skip to main content

ui.set_callback

Sets the change callback of a custom menu item. It will be executed on change and passed the reference

ui.set_callback(item: number, callback)

Arguments

NameDescriptionType
itemThe special value returned by ui.new_*. Do not try passing a reference to an existing menu item.number
callbackLua function that will be called when the menu item changes values. For example, this will be called when the user checks or unchecks a checkbox.function