Frame:RegisterUnitEvent()

From Wowpedia
Jump to: navigation, search

Registers the frame for a specific event, triggering the OnEvent handler when the event occurs for the specified units.

Frame:RegisterUnitEvent("event", "unit1"[, "unit2"])

The API function is available for any widget capable of having an OnEvent handler.

Arguments

event 
String - name of the event, e.g. "UNIT_POWER".
unit1 
String (unitId) - unit to deliver the event for.
unit2 
String (unitId) - second unit to deliver the event for.

Notes

  • A frame can only ever watch for events for two units using this mechanism. Repeated calls will overwrite old registrations.
  • You must unregister the event in order to switch to or from an Frame:RegisterEvent registration for the same event. Otherwise, the RegisterEvent call is silently ignored, and the filters remain in effect.

Patch changes

Mists of Pandaria Patch 5.0.4 (2012-08-28): Added.