Garry's Mod Wiki

Revision Difference

DComboBox:AddChoice#513427

<function name="AddChoice" parent="DComboBox" type="panelfunc">⤶ <ispanel>yes</ispanel>⤶ <description>Adds a choice to the combo box.</description>⤶ <file line="126-L146">lua/vgui/dcombobox.lua</file>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="value" type="string">The text show to the user.</arg>⤶ <arg name="data" type="any" default="nil">The data accompanying this string. If left empty, the value argument is used instead.&#xA;&#xA;Can be accessed with the second argument of &lt;page&gt;DComboBox:GetSelected&lt;/page&gt;, &lt;page&gt;DComboBox:GetOptionData&lt;/page&gt; and as an argument of &lt;page&gt;DComboBox:OnSelect&lt;/page&gt;.</arg>⤶ <arg name="select" type="boolean" default="false">Should this be the default selected text show to the user or not.</arg>⤶ <arg name="icon" type="Panel" default="nil">Adds an icon for this choice.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number">The index of the new option.</ret>⤶ </rets>⤶ </function>⤶ ⤶