Jump to content

guiGridList adding row


Hero192

Recommended Posts

i added an custom row to the gridlist it's section row ,when i add it other rows triggered from an table became not selectable when i selecte them and i click on the button nothing happen and when i remove this custom row it works, the music works correctly..

Any idea? Here's the part of my code where the problem is exist

addEvent ("callGUI", true) 
addEventHandler ("callGUI", root,  
function (Music) 
    guiSetVisible (window, true) 
    guiGridListClear(grid)  
    showCursor (true) 
    guiGridListSetItemText ( grid, guiGridListAddRow ( grid ), 1, "MyMusiclist", true, true ) --im talking about this row!! 
    for index, v in ipairs (Music) do 
    local row = guiGridListAddRow (grid) 
    guiGridListSetItemText (grid, row, 1, v[1], false, false) 
  end 
end) 

Link to comment

I don't exactly understand the problem here.

Try separating adding the row and setting the item's text:

local row = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, row, 1, "MyMusiclist", true, true ) 

If I recall correctly, I had a problem with something like that once.

Link to comment

Rows are always start counting from 0 ..1 ..2.. SO, you've to do row+1 on the selected rows to start it counting from 1..2..

If you already added a new row section like what you did ,so it doesn't matter for doing row +1

About what you did @JR10 its the same as first post you just defined it but it still the same meaning

--This code

local row = guiGridListAddRow ( grid ) 
guiGridListSetItemText ( grid, row, 1, "MyMusiclist", true, true ) 

--Is the same as

guiGridListSetItemText ( grid,  guiGridListAddRow ( grid ), 1, "MyMusiclist", true, true ) 

Edited by Guest
Link to comment

I understand that it's eventually the same thing, I just remember having a problem with a similar thing.

Are you using the selected row index to get the "Music" item's index? The section row will take the first index, so you don't need to row+1.

If you don't understand, post the code where you get the selected item's index.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...