DComboBox/AddChoice

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m
 
Line 24: Line 24:
 
}}
 
}}
 
{{Arg
 
{{Arg
|type=Panel
+
|type=string
 
|name=icon
 
|name=icon
 
|desc=Adds an icon for this choice.
 
|desc=Adds an icon for this choice.

Latest revision as of 11:21, 14 January 2020

 DComboBox:AddChoice( )

Contents

DescriptionPanelFunc

Adds a choice to the combo box.

Arguments

string value

The text show to the user.

Arguments

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.

Arguments

boolean select=false

Should this be the default selected text show to the user or not.

Arguments

string icon=nil

Adds an icon for this choice.

Returns

number

The index of the new option.
Personal tools
Navigation