Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does this fit your definition of a Callback?

Definition of Callback:

A Function that is set as a property within a Component. And is usually called when some event occurs on the Component.

For Example:

If you wish to display a dialog which reads "I was clicked" when the user clicks on the Component componentB, you would write a method stored as a variable which does this:

var mouseDownCallbackFunction = function() {
    alert("I was clicked!");
};

Next, you would set this function inside the component like so...

// Set the Component to display the dialog when the 
// user presses the mouse down on it.
componentB.setMouseDownCallback(mouseDownCallbackFunction);

And this would cause mouseDownCallbackFunction to display "I was clicked" in an alert box when the component was clicked.

like image 871
leeand00 Avatar asked Mar 05 '09 16:03

leeand00


1 Answers

Yes, this is describing the exact definition of a callback...

like image 194
John Rasch Avatar answered Sep 24 '22 21:09

John Rasch