DButton.SetSelected

From GMod Wiki

Jump to: navigation, search
Function
Syntax DButton.SetSelected( Boolean selected )
Where is this used?
Description:
Sets whether or not the button is constantly selected.
Returns: nil
Part of Library: DButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DButton.SetSelected]DButton.SetSelected [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a toggle button.
Used onNewerClient.png
Code
//Code creating a DFrame
 
local button = vgui.Create("DButton", SomeParent)
button.DoClick = function(self)
    if self:GetSelected() then
       self:SetSelected(false)
    else
       self:SetSelected(true)
    end
end
OutputA button that can be turned on/off.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox