ComboBoxExampleCode: Revision history

From Crumbled World Wiki

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

6 July 2025

  • curprev 07:5907:59, 6 July 2025Anders talk contribs 425 bytes +425 Created page with "==Example== <syntaxhighlight lang="lua"> function changeSetting(button) comboBox:setText(button:getTag()) end comboBox = panel:add(ComboBox(PanelSize(size), items[1])) local items = {"item1","item2","item3","item4"} for i=1, #items do local itemButton = comboBox:addItem( Button(PanelSize(Vec2(-1,0.03)), items[i]) ) itemButton:setTag(items[i]) itemButton:addEventCallbackExecute(changeSetting) end </syntaxhighlight>"