Jump to content

Don't know how


manve1

Recommended Posts

Can someone post me LUA code on how to make my LUA code to work? i tried re-making the whole script 10+ times.. and still i get same error.. it doesn't add text to gridList, thank you for helping.

I know it is wrong, im just starting to script and learn LUA.

 gui = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ) 
  
objects =  
    { 
    "WW1 hat", 
    "WW2 hat", 
    } 
     
    row = guiGridListAddRow ( grid ) 
    myGridList = guiCreateGridList ( 0.1, 0.10, 0.8, 0.60, true, gui ) 
    columnA = guiGridListAddColumn( grid, "ZM hats", 0.85 ) 
  
    guiGridListSetItemText ( myGridList, row, columnA, "WW1 hat", false, false )     
    guiGridListSetItemText ( myGridList, row, columnA, "WW2 hat", false, false )  

Link to comment
local hRow = nil; 
  
hWnd = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ); 
      
local aObjects = 
{ 
    "WW1 hat", 
    "WW2 hat"; 
}; 
        
hGrid = guiCreateGridList( 0.1, 0.10, 0.8, 0.60, true, hWnd ); 
guiGridListAddColumn( hGrid, "ZM hats", 0.85 ); 
  
for i,m_obj in ipairs( aObjects ) do 
    hRow = guiGridListAddRow( hGrid ); 
    -- 
    guiGridListSetItemText ( hGrid, hRow, 1, tostring( m_obj ), false, false ); 
end 

Isn't that what you want.

Link to comment
local hRow = nil; 
  
hWnd = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ); 
      
local aObjects = 
{ 
    "WW1 hat", 
    "WW2 hat"; 
}; 
        
hGrid = guiCreateGridList( 0.1, 0.10, 0.8, 0.60, true, hWnd ); 
guiGridListAddColumn( hGrid, "ZM hats", 0.85 ); 
  
for i,m_obj in ipairs( aObjects ) do 
    hRow = guiGridListAddRow( hGrid ); 
    -- 
    guiGridListSetItemText ( hGrid, hRow, 1, tostring( m_obj ), false, false ); 
end 

Isn't that what you want.

yeh, thank you

Link to comment
local hRow = nil; 
  
hWnd = guiCreateWindow( 0.1, 0.1, 0.2, 0.65, "Hats", true ); 
      
local aObjects = 
{ 
    "WW1 hat", 
    "WW2 hat"; 
}; 
        
hGrid = guiCreateGridList( 0.1, 0.10, 0.8, 0.60, true, hWnd ); 
guiGridListAddColumn( hGrid, "ZM hats", 0.85 ); 
  
for i,m_obj in ipairs( aObjects ) do 
    hRow = guiGridListAddRow( hGrid ); 
    -- 
    guiGridListSetItemText ( hGrid, hRow, 1, tostring( m_obj ), false, false ); 
end 

Isn't that what you want.

yeh, thank you

You're welcome.

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