Skip to content
João Cardoso edited this page Dec 5, 2019 · 22 revisions

Group is a frame class which inherits from Callable and allows to quickly generate entire menus. The menus are automatically updated and arranged.

Preview

Methods

Name Description
SetChildren (call) Adds an OnChildren handler for generating content and forces an update.
UpdateChildren Forces the group content to re-build.
Add (name or object [, args]) Adds a frame to the layout. If a Sushi class name is provided, generates a new frame using args. Should only be called during OnChildren.
AddBreak Adds a break to the layout. Should only be called during OnChildren.
SetOrientation (orientation) Sets the orientation of the group layout. Valid values are VERTICAL and HORIZONTAL.
GetOrientation Returns the orientation for the group's layout.
SetResizing (resizing) Sets in which direction the group should grow to fit all the content. Possible values are VERTICAL and HORIZONTAL.
GetResizing Returns the group's resizing orientation.

Calls

Name Description
OnResize Fired whenever the group changes dimensions.
OnChildren Fired during the content generation stage.

Example

local group = Sushi.Group(parent)
group:SetPoint('TOPLEFT')
group:SetOrientation('VERTICAL')
group:SetChildren(function()
  for i = 1, 12 do
    group:Add('HelpButton').left = 0
    group:Add('HelpButton').left = 0
    group:AddBreak()
  end
end)

Sushi-3.1 🍣

Documentation
Class Reference
Best Practices

Feedback
Post an issue

Clone this wiki locally