View Single Post
Old 07-09-2020, 10:23 AM   #726
solger
Human being with feelings
 
solger's Avatar
 
Join Date: Mar 2013
Posts: 4,718
Default

.list lets you get/set the current list values: https://jalovatt.github.io/scythe/#/...ements/Listbox

Here are two short examples to try:


1) Updating the squares table and passing this one to the listbox
PHP Code:
local squares = {149162536496481}

local function addText()
    
table.insert(squares99)
    
myListBox.list = squares
end 
2) Or updating the list directly:
PHP Code:
local squares = {149162536496481}

-- 
version 1
local 
function addText()
    
local listboxEntries myListBox.list 
    
table.insert(listboxEntries99)
end

-- version 2
local 
function addText()
    
table.insert(myListBox.list, 99)
end 
myListBox in the examples is the variable name:
Code:
 
local myListBox = GUI.createElement({
...
As mentioned in the link, calling Listbox:recalculateWindow() is only necessary when changing certain listbox parameters:
Quote:
Listbox:recalculateWindow()
Update internal values for the window size. If you change the listbox's w, h, pad, or textFont, this method should be called afterward.
__________________
ReaLauncher

Last edited by solger; 07-09-2020 at 10:35 AM.
solger is offline   Reply With Quote