manve1 Posted August 25, 2012 Posted August 25, 2012 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
Castillo Posted August 25, 2012 Posted August 25, 2012 That's because you forgot to add the row with: guiGridListAddRow San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted August 25, 2012 Author Posted August 25, 2012 Like this never helps most people, can you give example with it? Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted August 25, 2012 Posted August 25, 2012 Click the link which redirects to the wiki and read the example. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anderl Posted August 25, 2012 Posted August 25, 2012 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
manve1 Posted August 26, 2012 Author Posted August 26, 2012 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
Anderl Posted August 26, 2012 Posted August 26, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now