I made a shopping list where you would select the category and items according to the category would show up, but after you choose another category the previous items don't leave the list they are under neath the new items. So I wanted to know if there is anything the replaces GMod 12s RemoveItem and how would it look if I used it. All the code is fine, if you really need to see it I will give you a edited version removing unneeded shit and only the things within the combo box (category's)
Looks like [URL=https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dpanellist.lua#L225]RemoveItem still exists[/URL].
Why not just clear the list of all items and then just add in the new items?
[QUOTE=Braden1996;45389457]Why not just clear the list of all items and then just add in the new items?[/QUOTE]
Just use Panel:Clear(true) to clear it's contents before adding new entries. (the boolean passed states whether to delete the row itself or just hide it)
fixed
You are creating a new DPanelList child every time you click the button. Stop creating the DPanelList inside OnSelect and make it before.
nvm
Sorry, you need to Log In to post a reply to this thread.