Garry's Mod Wiki

Panel:GetSelectionCanvas

  Panel Panel:GetSelectionCanvas()

Description

Returns the selection canvas for this panel. This will be the first parent that has Panel:SetSelectionCanvas set to true (or self if this panel is the selection canvas)

A selection canvas would be the panel that contains a bunch of selectable panels (Panel:SetSelectable), usually for the drag'n'drop system. Calling this function on any of the selectable items, or any of their children, will return the first parent that can contain selectable panels.

Returns

1 Panel
The selection canvas, otherwise nil.