Jump to content

Gridlist autosize


AMARANT

Recommended Posts

Guest Guest4401
Posted

Do you mean columns? Because rows don't need an autosize.

guiGridListAutoSizeColumn 

Posted

Solidsnake, the thing is that in my gridlist might be either one row or twenty rows. So I thought that I could make some kind of autosized gridlist but all my attempts with loop and counting rows led to no good :(

Posted

Why can't you resize it every time you add a row?

GUIEditor_Grid = {} 
GUIEditor_Grid[1] = guiCreateGridList(379,0,203,25,false) 
guiGridListAddColumn(GUIEditor_Grid[1],"Items:",0.70) 
  
for index = 1, 40 do 
    local row = guiGridListAddRow ( GUIEditor_Grid[1] ) 
    guiGridListSetItemText ( GUIEditor_Grid[1], row, 1, "Item ".. index, false, false ) 
    local x, y = guiGetSize ( GUIEditor_Grid[1], false ) 
    guiSetSize ( GUIEditor_Grid[1], x, y + 15, false ) 
end 

I'd that as test, it leaves some space though.

Posted

Solidsnake14, thanks for your example. My attempt had some empty space too but it was much more bigger than yours. I think that will do for me. Thanks again.

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...