P.DoClick

From GMod Wiki

Revision as of 02:16, 1 May 2009 by UnrealomegaBot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameDoClick
SyntaxPANEL:DoClick( X, Y )
DescriptionThis is called whenever the mouse is clicked on a panel.
ReturnsNil
Lua StateNewerClient.png
BBCode[b][url=wiki.garrysmod.com/?title=P.DoClick]P.DoClick [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionWhat your program loads when you click on something,like a button.
Used onNewerClient.png
Code
 
function BlahDerma()
 
    local DermaPanel = vgui.Create( "DFrame" )
    DermaPanel:SetPos( 50, 50 )
    DermaPanel:SetSize( 500, 500 )
    DermaPanel:SetTitle( "Austin's Derma" )
    DermaPanel:SetVisible( true )
    DermaPanel:SetDraggable( true )
    DermaPanel:ShowCloseButton( true )
 
    local DermaButton1 = vgui.Create( "DButton" )
    DermaButton1:SetParent( DermaPanel )
    DermaButton1:SetText( "Kill yourself" )
    DermaButton1:SetPos( 25, 50 )
    DermaButton1:SetSize( 150, 50 )
    DermaButton1.DoClick = function () -- This is DoClick
        RunConsoleCommand( "kill" )
    end
end
 
concommand.Add("testderma", BlahDerma) -- testderma is the command to open this panel
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox