Garry's Mod Wiki

Panel:SetTooltipPanel

Panel:SetTooltipPanel( Panel tooltipPanel = nil )

Description

Sets the panel to be displayed as contents of a DTooltip when a player hovers over the panel object with their cursor. See Panel:SetTooltipPanelOverride if you are looking to override DTooltip itself.

Panel:SetTooltip will override this functionality.
Calling this from PANEL:OnCursorEntered is too late! The tooltip will not be displayed or be updated.
Given panel or the previously set one will NOT be automatically removed.

Arguments

1 Panel tooltipPanel = nil
The panel to use as the tooltip.

Example

Example usage of this function

local pnl = vgui.Create( "DFrame" ) pnl:SetSize( 500, 500 ) pnl:Center() pnl:MakePopup() local p = vgui.Create( "Panel" ) p:SetSize( 100, 100 ) p:SetVisible( false ) p.Paint = function( s, w, h ) draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 0, 0 ) ) end local c = vgui.Create( "DButton", p ) c:SetText( "test" ) c:SetSize( 50, 50 ) c:SetPos( 5, 5 ) local b = pnl:Add( "DButton" ) b:Dock( TOP ) -- b:SetTooltip( "test" ) -- This will stop SetTooltipPanel from working. b:SetTooltipPanel( p )

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 4
Generate Html 5
SaveChanges (1) 9
Render Body 0
Render Sidebar 13