API GetFramesRegisteredForEvent

From Wowpedia
Jump to: navigation, search

Returns all frames registered for the specified event, in dispatch order.

frame1, frame2, ... = GetFramesRegisteredForEvent("event")

Arguments

event
String - Event for which to return registered frames, e.g. "PLAYER_LOGOUT"

Returns

frame1, ...
Widget - widget registered for the specified event.

Details

  • The first frame returned will be the first to receive the given event, and likewise the last returned will receive the event last. A frame can be moved to the end of this event list order by unregistering and then reregistering for the event.

Example

The snippet below unregisters the PLAYER_LOGOUT events from every frame listening for it

local function unregister(event, widget, ...)
 if widget then
  widget:UnregisterEvent(event)
  return unregister(event, ...)
 end
end
unregister("PLAYER_LOGOUT", GetFramesRegisteredForEvent("PLAYER_LOGOUT"))

Patch history

The Burning Crusade Patch 2.3.0 (2007-11-13): Added.