Garry's Mod Wiki

Garry's Mod Wiki

  number DComboBox:AddChoice( string value, any data = nil, boolean select = false, string icon = nil )

Description

Adds a choice to the combo box.

Arguments

1 string value
The text show to the user.
2 any data = nil
The data accompanying this string. If left empty, the value argument is used instead.

Can be accessed with the second argument of DComboBox:GetSelected, DComboBox:GetOptionData and as an argument of DComboBox:OnSelect.

3 boolean select = false
Should this be the default selected text show to the user or not.
4 string icon = nil
Adds an icon for this choice.

Returns

1 number
The index of the new option.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...