DMenu/AddOption

From Garry's Mod
Jump to: navigation, search
 DMenu:AddOption( )

Contents

DescriptionPanelFunc

Add an option to the DMenu

Arguments

string name

Name of the option.

Arguments

function func=nil

Function to execute when this option is clicked.

Returns

Panel

Returns the created DMenuOption panel.

Examples

Example

Creates a DMenu with 2 options: One that kills yourself; One that does nothing.

local m = DermaMenu()

m:AddOption( "Suicide", function() RunConsoleCommand("kill") end )
m:AddOption( "It does nothing" )

m:Open()


Personal tools
Navigation