Gooey scrollbar for cloned grid?

(I found a ticket for grids being handled by Gooey but I am not sure if this touches my question.)

I have a level overview screen with preview images. I clone those and layout them in a grid. Then I wanted to use Gooey’s vertical scrollbar to, well, scroll them. After two afternoons wasted trying to figure out what to feed it, I am getting the impression that Gooey handles lists it makes itself just fine, but perhaps not my grid?
What can I do to get it to work, stop layouting the grid and let Gooey make a static list? Because so far I have been adding a lot of lines myself to get it to scroll anything at all, when I thought my case is basically solved in three lines.

In the example project, here:

local list = gooey.dynamic_list(“dynamiclist_bg”, “dynamiclist_stencil”, “listitem_bg”, self.list_data, action_id, action, nil, function(list)
print(“selected dynamic list item”, list.selected_item.index, list.data\[list.selected_item.index\].text)
end, refresh_dynamiclist)

gooey.vertical_scrollbar(“scrollbar_handle”, “scrollbar_bg”, action_id, action, function(scrollbar)
list.scroll_to(0, scrollbar.scroll.y)
end)

Can/shouddl I fill the list with:

function M.static_list(list_id, stencil_id, item_ids, action_id, action, config, fn, refresh_fn)
local l = list.static(list_id, stencil_id, item_ids, action_id, action, config, fn or nop, refresh_fn)
if current_group then
current_group.components\[#current_group.components + 1\] = l
end
return l
end

Sorry for being a basketcase here for something so simple. Everybody else has figured out Gooey but me. Sliders are a pain to make so I will happily use a library IF I can finally wrap my head around it.

Nevermind, I found a solution :slight_smile:

1 Like