Skip to content

Window

A movable, resizable top-level window with a title bar and a Close button; a lighter-weight alternative to Frame, without a status bar.

Create with AceGUI:Create("Window"). This is a container; it inherits the Common Widget API and container methods (AddChild, SetLayout, ReleaseChildren, etc.).

Widget type: Window

Methods

SetTitle

method#
lua
container:SetTitle(title)

Set the text shown in the window's title bar.

Parameters

ParameterTypeDefaultDescription
titlestringThe title string.

SetStatusText

method#
lua
container:SetStatusText(text)

No-op. Window has no status bar; the method exists for API compatibility with Frame but does nothing (the body is commented out in source).

Parameters

ParameterTypeDefaultDescription
textstringIgnored.

SetStatusTable

method#
lua
container:SetStatusTable(status)

Supply an external table in which the window stores and restores its position and size (width, height, top, left). Applies the table immediately. Use this to persist window geometry between sessions.

Parameters

ParameterTypeDefaultDescription
statustableAn external table (asserted to be of type table) used to store and restore position and size.

ApplyStatus

method#
lua
container:ApplyStatus()

Apply the current status table (external, or the internal localstatus): sets width (default 700) and height (default 500) and positions the window. If top and left are present it anchors to those coordinates, otherwise it centers the window.

EnableResize

method#
lua
container:EnableResize(state)

Show or hide the three resize grips (bottom-right, bottom, right edges), enabling or disabling user resizing.

Parameters

ParameterTypeDefaultDescription
statebooleanTruthy shows the resize grips; falsy hides them.

Show

method#
lua
container:Show()

Show the underlying frame.

Hide

method#
lua
container:Hide()

Hide the underlying frame. (Hiding fires OnClose; see Callbacks.)

Callbacks

OnShow

callback#
lua
OnShow()

Fired when the window is shown.

OnClose

callback#
lua
OnClose()

Fired when the window is hidden, including when the user clicks the built-in Close button, which calls Hide().

Layout notes

Like all containers, the window defaults to the "List" layout; switch with SetLayout (commonly "Flow"). The content region is inset from the window edges (34 px horizontally, 57 px vertically). The window is movable by dragging the title bar and resizable via the grips; minimum size is 240×240, default size 700×500.

Example

lua
local window = AceGUI:Create("Window")
window:SetTitle("My Window")
window:SetLayout("List")
window:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)

local label = AceGUI:Create("Label")
label:SetText("Content inside a Window container.")
label:SetFullWidth(true)
window:AddChild(label)

Ace3, a World of Warcraft addon framework.