Garry's Mod Wiki

PANEL:Init

  PANEL:Init()

Description

Called when the panel is created. This is called for each base type that the panel has.

Example

Shows how this method is called recursively for each base type a panel has.

local BASE = {} function BASE:Init() print("Base Init Called") end local PANEL = {} function PANEL:Init() print("Panel Init Called") end vgui.Register("MyBase", BASE, "DFrame") vgui.Register("MyPanel", PANEL, "MyBase") local panel = vgui.Create("MyPanel")
Output: Base Init Called

Panel Init Called