GuiGridListGetColumnCount

From Multi Theft Auto: Wiki
Jump to: navigation, search

This allows you to get the count of existing columns in a gridlist.

Syntax

int guiGridListGetColumnCount ( element gridList )

Required Arguments

  • gridList: The grid list you want to add a column to

Returns

Returns an integer with the amount of columns in the gridlist, false otherwise.

Example

This example outputs number of columns in gridList to chatBox when player uses command getColumns.

addCommandHandler("getColumns",
function(command)

local columns = guiGridListGetColumnCount(theGridList)

if columns < 1 then
	outputChatBox("There are no columns.")
elseif columns >= 1 then
	outputChatBox("There are " .. tostring(columns) .. " columns.")
else
	outputChatBox("Unable to get number of columns.")
	
end	
end)

See Also

GUI functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Fields

FROM VERSION 1.5.5 r12419 ONWARDS

Gridlists

Memos

FROM VERSION 1.5.5 r12419 ONWARDS

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

GUI events