Panel.HasFocus

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:HasFocus( )
Description:
Returns true if the panel has the keyboard focus
Returns: Boolean
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.HasFocus]Panel.HasFocus [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionIf the panel p has the focus, then it remove the focus. If it doesn't have the focus, it requests it.
Used onNewerClient.png
Code
// P = a Panel object
if (P:HasFocus()) then
    Msg("P has the focus!\n")
    P:KillFocus()
else
   Msg("Requesting focus!\n")
   P:RequestFocus()
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox