denny199 Posted March 4, 2012 Posted March 4, 2012 Hey there, i was wondering, can i change the color off the gridlist example vehicles: I'm using this: guiGridListSetItemColor (wndCreateVehicle, rows, columns, 255,0,0) but now a error, btw, i don't know what the gridlist is. error: attempt to call a boolean value error: expected gui element @ argument 1 --------------------------- -- Create vehicle window --------------------------- function createSelectedVehicle(leaf) if not leaf then leaf = getSelectedGridListLeaf(wndCreateVehicle, 'vehicles') if not leaf then return end end server.giveMeVehicles(leaf.id) end wndCreateVehicle = { 'wnd', text = 'Create vehicle', width = 300, controls = { { 'lst', id='vehicles', width=280, height=340, columns={ {text='Vehicle', attr='name'} }, rows={xml='vehicles.xml', attrs={'id', 'name'}}, onitemdoubleclick=createSelectedVehicle }, --Error here --guiGridListSetItemColor (wndCreateVehicle, rows, columns, 255,0,0) -- i setted this but a error:/ {'btn', id='create', onclick=createSelectedVehicle}, {'btn', id='close', closeswindow=true} } } Sometimes I dream about cheese
Castillo Posted March 4, 2012 Posted March 4, 2012 That'll never work. You can do this: addEventHandler("onClientGUIClick",root, function () if ( source == getControl(wndCreateVehicle,"vehicles") ) then for row=0, guiGridListGetRowCount(getControl(wndCreateVehicle, "vehicles")) do guiGridListSetItemColor(getControl(wndCreateVehicle, "vehicles"),row,1,0,255,0) end end end ) It'll set the all grid list rows to green. 1 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted March 5, 2012 Posted March 5, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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