WoW:API EnumerateFrames: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(upgraded deprecated template)
m (Move page script moved page API EnumerateFrames to API EnumerateFrames without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
<center>'''EnumerateFrames''' ''-Documentation by [[user:Aradan|Aradan]]-''</center>


Returns frame which follows current frame, or first frame if argument is nil.
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})
  nextFrame = EnumerateFrames({currentFrame})
Line 18: Line 17:


== Example ==
== Example ==
<pre>
  local frame = EnumerateFrames()
  local frame = EnumerateFrames()
  while frame do
  while frame do
Line 25: Line 25:
     frame = EnumerateFrames(frame)
     frame = EnumerateFrames(frame)
  end
  end
</pre>


==== Result ====
==== Result ====

Latest revision as of 04:45, 15 August 2023

WoW API < EnumerateFrames

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[edit]

Arguments[edit]

({currentFrame})
currentFrame
Table - current frame or nil to get first frame

Returns[edit]

nextFrame
nextFrame
Table - the frame following currentFrame or nil if no more frames

Example[edit]

 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[edit]

Prints the names of all visible frames under the mouse cursor to the default chat frame.