guiGridListGetColumnWidth | Multi Theft Auto: Wiki Skip to content

guiGridListGetColumnWidth

Client-side
Server-side
Shared

Pair: guiGridListSetColumnWidth

This allows you to get the width of an existing column in a gridlist.

OOP Syntax Help! I don't understand this!

Syntax

float|false guiGridListGetColumnWidth ( ​gui-gridlist gridList, ​int columnIndex, [ ​bool relative = false ] )
Required arguments
  • gridList: The grid list whose column width you want to get.
  • columnIndex: Column ID. Indexes start at 1.
Optional arguments

Note: when using optional arguments, you might need to supply all arguments before the one you wish to use.

  • relative (default: false): A boolean defining whether width measurements will be relative to the gridlist size, or absolute pixels.

Returns

Returns the width of the gridlist column, false if bad arguments were given.

  • float|false: column width

Code Examples

client
local grid = guiCreateGridList(313, 354, 162, 100, false)
local c = guiGridListAddColumn(grid, "test", 0.5)
addCommandHandler("width", function()
local w = guiGridListGetColumnWidth(grid, c, true)
outputChatBox("Column width = " .. w)
end)

See Also

GUI Functions