GuiGridListGetColumnCount: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(OOP syntax)
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int guiGridListGetColumnCount ( element gridList )
int guiGridListGetColumnCount ( element gridList )
</syntaxhighlight>  
</syntaxhighlight>
{{OOP||[[Element/GUI/Gridlist|GuiGridList]]:getColumnCount|columnCount}}


===Required Arguments===  
===Required Arguments===  

Revision as of 21:08, 7 November 2018

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

Syntax

int guiGridListGetColumnCount ( element gridList )

OOP Syntax Help! I don't understand this!

Method: GuiGridList:getColumnCount(...)
Variable: .columnCount


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

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI