Skip to content
João Cardoso edited this page Dec 4, 2019 · 5 revisions

Callable is an abstract class which exposes methods for registering and firing custom frame events. Calls works much alike the native SetScript and GetScript methods, except multiple handlers are supported for a single event. Registered handlers are cleared on :Release.

Callable also happens to be one of the most core classes of Sushi, and most other classes derive from it. Hence, many classes will display a list of call events in their documentation.

Methods

Name Description
SetCall (event, handler) Sets the widget's handler function for the event.
GetCalls (event) Returns the widget's handler functions for the event.
FireCalls (event, ...) Calls the widget's handler functions for the event with the given arguments. Generally, should only be called by the class implementation.

Example

someFrame:SetCall("OnTextChanged", function(self, text)
	print("Text changed to:", text)
end)

someFrame:FireCalls("OnTextChanged", "Banana")
// Text changed to: Banana

Sushi-3.1 🍣

Documentation
Class Reference
Best Practices

Feedback
Post an issue

Clone this wiki locally