Closed chicogamedev closed 2 years ago
You should be using BeginListBox
and EndListBox
before calling BeginListBoxItem
. See https://github.com/flamendless/Slab/wiki/ListBox#BeginListBox
Yeah sorry since the error was not here with the older version of Slab, these calls are around the given code. Sorry for not showing them.
Slab.BeginListBox("projectsList", { Clear = self.projectsListUpdate, StretchW = false, StretchH = true, W = 440, AlignX = "Center" })
self.projectsListUpdate = false
for k, v in ipairs(self.projectsList) do
Slab.BeginListBoxItem("projectItem" .. k, { Selected = self.selectedProjectIndex == k } )
Slab.Text(v.name)
if (Slab.IsListBoxItemClicked()) then
self.selectedProjectIndex = k
end
if (Slab.IsListBoxItemClicked(1, true)) then
self:loadProject(k)
end
Slab.EndListBoxItem()
end
Slab.EndListBox()
Indeed, there is an error in latest commit. Will fix soon
Thanks !
Fixed now :)
I have this piece of code :
I got this error (not with current released version of Slab) :
Error: libs/slab/Internal/UI/ListBox.lua:151: Begin was called for item 'nil' without a call to EndListBoxItem stack traceback:
It seems that active.ActiveItem is nil for whatever reason.