guiGridListSetColumnWidth | Multi Theft Auto: Wiki Skip to content

guiGridListSetColumnWidth

Client-side
Server-side
Shared

Pair: guiGridListGetColumnWidth

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

OOP Syntax Help! I don't understand this!

Syntax

bool guiGridListSetColumnWidth ( ​gui-gridlist gridList, ​int columnIndex, ​number width, [ ​bool relative = false ] )
Required arguments
  • gridList: The grid list you want to add a column to.
  • columnIndex: Column ID of the size you want to change. Indexes start at 1.
  • width: A float or integer of the width of the column depending on the relative argument.
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 true if the gridlist column width was successfully set, false if bad arguments were given.

  • bool: result

Code Examples

client

This example creates a gridlist with one column that is too small to display. After the column has been successfully created, we give it a new width so you can see column.

local gridlist = guiCreateGridList(332, 195, 286, 249, false)
local column = guiGridListAddColumn(gridlist, "My column", 0)
if column then
guiGridListSetColumnWidth(gridlist, column, 0.5, true)
end

See Also

GUI Functions