Garry's Mod Wiki

DMenu:AddOption

Panel DMenu:AddOption( string name, function func = nil )

Description

Add an option to the DMenu

Arguments

1 string name
Name of the option.
2 function func = nil
Function to execute when this option is clicked.

Returns

1 Panel
Returns the created DMenuOption panel.

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()

Page Links


Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 3
Generate Html 7
SaveChanges (1) 15
Render Body 0
Render Sidebar 13