Garry's Mod Wiki


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


Adds a choice to the combo box.


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.


1 number
The index of the new option.