Rick Posted November 24, 2011 Share Posted November 24, 2011 Has anyone used Josh's Lua GUI? I'm looking at the ListView control and it hurts my mind trying to understand the way he structured it. The view has a line table, which has a column table (I'm good at this point), which columns have a linetext table? Not following the reasoning with that as the linetext table seems to store text in all columns. I would think you'd just have text for each column for that line and not a table of text for every line inside the column table. Anyway, I'm trying to make a method to delete a specific line if the column has a certain value. I can get it to delete (sort of), but the deleted line still has an alt color and I can select it. When I return the lines table count of the view it only says 1 so not sure what's up. This is probably a long shot but it's really bugging me. My code function ListView:RemoveLine(column, value) -- loop through lines checking to find a value to match in the column param local id = -1 for k, v in pairs(self.lines) do if v:GetColumnText(column) == value then id = v.id -- loop through columns in this line and delete them for index, value in ipairs(v.columns) do table.remove(value.linetext, id) --value.linetext = {} end end end -- remove the line also if id ~= -1 then table.remove(self.lines, id) end end Quote Link to comment Share on other sites More sharing options...
Rick Posted November 24, 2011 Author Share Posted November 24, 2011 It's the kids table!! Man I was scratching my head as to why the line was still being drawn even after I removed it. I have to remove it from the kids table also! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.