Not sure how robust it is, but this works and is dynamic with button and amount to be picked up https://github.com/tilkinsc/KiwiQuickPick ... now available on curseforge https://www.curseforge.com/wow/addons/kiwi-quick-pick
I have quite a bit of knowledge of the bag so far. I will take a crack at it. If I do produce results, it won't support one-bag or ui changing interfaces.
If you drop me the link to the repo I should be able to decipher it into working classic code, as long as it isn't needlessly library ridden.
Frames are a bit finicky. You will need to show everything the frame has inside of it. So, for example, you create a base frame with 4 text lines (each are frames), you will have to show the base frame then the 4 text line frames.
At least, that's at first glance. I have only been playing with tooltips https://www.curseforge.com/wow/addons/kiwi-item-info
As far as X, Y, Z positions go, you probably can look at the code base of questie https://github.com/AeroScripts/QuestieDev
What is a list box?