Panel.SetTooltip

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:SetTooltip( String or Boolean )
Where is this used?
Description:
Sets if a tooltip is enabled.
Returns: nil
Part of Library: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.SetTooltip]Panel.SetTooltip [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionTo disable tooltips
Used onNewerClient.png
Code
local icon = vgui.Create( "SpawnIcon", ProfilePage )
	icon:SetModel( model )
	icon:SetTooltip( false )
 
OutputN/A

DescriptionTaken from (Source Code)
Used onNewerClient.png
Code
local Icon = vgui.CreateFromTable( WeaponIcon, self )
Icon:Setup( WeaponTable.PrintName or WeaponTable.ClassName, WeaponTable.ClassName, WeaponTable.SpawnMenuIcon, WeaponTable.AdminSpawnable && !WeaponTable.Spawnable )
local Tooltip =  Format( "Name: %s", WeaponTable.PrintName )
if ( WeaponTable.Author != "" ) then Tooltip = Format( "%s\nAuthor: %s", Tooltip, WeaponTable.Author ) end
if ( WeaponTable.Contact != "" ) then Tooltip = Format( "%s\nContact: %s", Tooltip, WeaponTable.Contact ) end
if ( WeaponTable.Instructions != "" ) then Tooltip = Format( "%s\n\n%s", Tooltip, WeaponTable.Instructions ) end
Icon:SetTooltip( Tooltip )
 
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox