WoW:API EnumerateFrames: Difference between revisions
Jump to navigation
Jump to search
(Added note about frame iteration order.) |
|||
Line 17: | Line 17: | ||
== Example == | == Example == | ||
<pre> | |||
local frame = EnumerateFrames() | local frame = EnumerateFrames() | ||
while frame do | while frame do | ||
Line 24: | Line 25: | ||
frame = EnumerateFrames(frame) | frame = EnumerateFrames(frame) | ||
end | end | ||
</pre> | |||
==== Result ==== | ==== Result ==== |
Revision as of 03:55, 5 April 2022
Returns frame which follows current frame, or first frame if argument is nil. The order of iteration follows the order that the frames were created in.
nextFrame = EnumerateFrames({currentFrame})
Parameters
Arguments
- ({currentFrame})
- currentFrame
- Table - current frame or nil to get first frame
Returns
- nextFrame
- nextFrame
- Table - the frame following currentFrame or nil if no more frames
Example
local frame = EnumerateFrames()
while frame do
if frame:IsVisible() and MouseIsOver(frame) then
DEFAULT_CHAT_FRAME:AddMessage(frame:GetName())
end
frame = EnumerateFrames(frame)
end
Result
Prints the names of all visible frames under the mouse cursor to the default chat frame.