Garry's Mod Wiki

DProperty_Combo:AddChoice

  DProperty_Combo:AddChoice( string Text, any data, boolean select = false )

Description

Add a choice to your combo control.

Arguments

1 string Text
Shown text.
2 any data
Stored Data.
3 boolean select = false
Select this element?

Example

Set the "I am selected" option selected.

local choice = DP:CreateRow( "Choices", "Hello world" ) choice:Setup( "Combo" ) choice:AddChoice( "I am a choice", {} ) choice:AddChoice( "I am selected", 8, true ) choice:AddChoice( "I am not selected", "Hello world" )