Garry's Mod Wiki

DermaMenu

Panel DermaMenu( boolean keepOpen = false, Panel parent = nil )

Description

Creates a DMenu and closes any current menus.

Arguments

1 boolean keepOpen = false
If we should keep other DMenus open (true) or not (false).
2 Panel parent = nil
The panel to parent the created menu to.

Returns

1 Panel menu
The created DMenu.

Example

Creates a DMenu with buttons to commit suicide or close it.

local menu = DermaMenu() menu:AddOption( "Die", function() RunConsoleCommand( "kill" ) end ) menu:AddOption( "Close", function() print( "Close pressed" ) end ) -- The menu will remove itself, we don't have to do anything. menu:Open()
Output:

Page Links


Special Pages


Wikis

?

Render Time: 137ms

DB GetPage 74
Generate Html 5
SaveChanges (1) 49
Render Body 0
Render Sidebar 6