G.DermaMenu

From GMod Wiki

Revision as of 17:41, 27 August 2011 by TheFreeman193 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax DermaMenu( )
Where is this used?
Description:
Creates a DMenu at the cursor's current position.
Returns: DMenu
Part of Library: Global Functions
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.DermaMenu]G.DermaMenu [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionCreate a menu
Used onNewerClient.png
Code
local frame = vgui.Create("DFrame")
frame:SetSize(300,300
frame:Center()
frame:MakePopup()
 
local button = vgui.Create("DButton")
button:SetPos(30,30)
button:SetSize(75,25)
button.DoClick = function()
    local menu = DermaMenu()
    menu:AddOption("Hello world!",function() print("Hello world!") end)
    menu:Open()
end
OutputMakes a drop-down menu when you click the button


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox