Jump to content

Don't know how


manve1

Recommended Posts

Posted

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 )  

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

That's because you forgot to add the row with:

guiGridListAddRow 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Click the link which redirects to the wiki and read the example.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted
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

Looking for tutorials or information? check out: www.simpleask.co.uk

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

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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