View Single Post
05/11/16, 02:23 PM   #20
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Letho View Post
I understand, would u advice not to use ZO_ScrollContainer but ZO_ScrollList instead? I find the container version far more simple :/

Can you describe how to set up a scrollbar for a ZO_ScrollContainer and how to use its scrolling event handler?
I've never used ZO_ScrollContainer, and I wouldn't use it in this case, either. Here's how I see it:
- ZO_ScrollContainer for UI widgets -- a number of controls, often of different types, shapes and sizes; each with a specific purpose -- a good example is LibAddonMenu's panel control
- ZO_ScrollList for lists of similar items -- like inventory; here the controls (rows) are not special, any of them can display any data item. You wouldn't want the guild bank UI to actually contain 500 rows. ZO_ScrollList does all the work required to create the illusion of there being 500 rows, while it only constructs as many row controls as are simultaneously visible.

You have N icons, M per row. So you'll add ceil(N/M) data rows to the list (simple tables containing up to M texture paths), and your row control setup function will set the textures on icon controls in the row.

Originally Posted by Letho View Post
Btw. are these controls and it's functions documented somewhere? Getting help is always good, but i dont want you to get the impression im just asking here becuz im too lazy to read a documentation I just did research for the last two days and i'm really getting more and more desperate, especially if i consider my addon is nearly finished with the scroll container problem being the only thing standing in my way ;D
We've all learned from The Source and/or other add-ons Don't get overwhelmed, you'll find your way around much more easily after you get used to how the UI is structured (I think 83% of it are lists).
  Reply With Quote