• Invert DPanelList
    3 replies, posted
How could I invert a DPanelList so it will show the most recent addition at the bottom of the panel instead of the top?
Perhaps something like this? [lua]local items = panel_list:GetItems(); panel_list:Clear(); for i = #items, 1 do panel_list:AddItem(items[i]) end[/lua]
[QUOTE=Entoros;23606766]Perhaps something like this? [lua]local items = panel_list:GetItems(); panel_list:Clear(); for i = #items, 1 do panel_list:AddItem(items[i]) end[/lua][/QUOTE] Seems to put it roughly 20 pixels down from the top, also only allows the first item to be placed.
[lua]for i = #items, 1, -1 do[/lua] The step (third value) is one by default. It needs to be -1 for a reverse loop to work.
Sorry, you need to Log In to post a reply to this thread.