Optionalon-- Create new container
local newWindow = osrs.Ui.window({title = "Example Window"})
-- Create a new dropdown menu with a change function
local menu = osrs.Ui.dropdown(
{
label = "Test",
values = {"Test1", "Test2", "Test3"},
onValueChange = function()
osrs.print("Change")
end
}
)
-- Add dropdown to the container
newWindow:addChild(menu)
-- Add container to the canvas
osrs.Ui.canvas:addChild(newWindow)
The function callback invoked when the element's value is changed.