General > Developers Corner

XLib Documentation

<< < (2/5) > >>

roastchicken:
Can you give us a code snippet to show exactly what you're doing?

captain1342:
http://pastebin.com/1NPCpcdD

Thats where I get Currently Errors

and here is the Error:


[ERROR] lua/vgui/dlistview.lua:107: attempt to index local 'Line' (a nil value)
  1. RemoveLine - lua/vgui/dlistview.lua:107
   2. DoClick - addons/msync/lua/ulx/xgui/settings/cl_msync_gui.lua:162
    3. unknown - lua/vgui/dlabel.lua:232

it means this MSync.Modules.enabledModulesList:AddLine( MSync.Modules.enabledModulesList:GetSelected()[1]:GetValue() )

but i dont see anything wrong with it

roastchicken:
I don't think it's that line. The error references RemoveLine, but the line you're saying is causing the error doesn't remove a line; it adds one. My best guess is that it's the next line, but I can't be sure unless you give me the entire file so I can cross reference the line numbers. I'm on an airplane now, posting this via the in-plane WiFi (painfully slow in-plane WiFi, might I add. But I am on a plane, thousands of feet up in the air, so I'm not sure why I expected better), so I can't test what DListView:GetSelected returns. But my guess is that when it returns a table of the lines (according to the wiki), it's not returning a table of the line numbers. I'll do some spelunking in the code for DListView to see what exactly GetSelected returns and how to get the line number from a line (because it doesn't seem to be documented in the wiki) and get back to you.

edit 2: The magic of GitHub strikes again. If the version of DListView_Line on GitHub is to be trusted, then you should be able to do something like Line:GetID() and supply that as the argument to DListView:RemoveLine(). I should probably be a good citizen and document this on the wiki, but I'm lazy and not looking forward to waiting for the page to load on this slow WiFi. Maybe once I get home.

An additional, less important, fact is that DListView:GetSelected()[1] is identical to DListView:GetSelected() (according to the wiki, at least. It's proven to be less than accurate in the past, but usually pretty good).

edit: Looking back at the previous replies, I'm very much confused what this has to do with XLib or making things invisible.

captain1342:
GetSelected returns a Table cause it allows to give the full Selection back .. but strangely it stays Empty and says its nil but that cant be true .. i mean i see the entries.. also it is add line cause remove line is doing its job but re adding the line to the other table doesent work

roastchicken:
I'm not sure what your issue is. Are you still having errors?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version