Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API Frame RegisterEvent

From Wowpedia
Jump to: navigation, search

Registers which events the object would like to monitor.

success = frame:RegisterEvent("event")


string - The name of the event to register the object as monitoring.


boolean - Returns true if the event was successfully registered, false if (already) registered.


The snippet below creates a frame, registers it for the CHAT_MSG_YELL event, and sets an OnEvent handler that would print a message whenever that event fires -- whenever you hear someone /yell.

local frame = CreateFrame("Frame")
frame:SetScript("OnEvent", function(self, event, ...)
 print("Argh, stop with the yelling!")


  • Attempting to register for a non-existing event is silently ignored; Frame:IsEventRegistered("event") returns nil in such a case.

Battle for Azeroth Patch 8.0.1 (2018-07-17): Since patch 8.0.1 registering a non-existing event will raise an error.

  • Widgets are notified of an event in order of event registration: the last widget to register for an event will be the last one to receive it.

See also