Grid functions process messages automatically, without bothering your program. In other words, grids operate themselves, independent of your program, without its knowledge or assistance.
On the other hand, sometimes events occur that your program needs to know about. For example, when you click on an XuiPushButton or press the Enter key in an XuiTextLine grid, your program usually needs to know it happened.
That's when grids send a callback message.
Who receives callback messages from a particular grid?
The callback function most recently assigned to the grid as follows:
XuiSendMessage ( grid, #SetCallback, gridToCall, &FuncToCall(), -1, -1, -1, 0 )
This makes FuncToCall() the callback function for grid . Thereafter, when grid has a callback message to send, it calls:
FuncToCall ( gridToCall, message, v0, v1, v2, v3, kid, grid )
FuncToCall() and gridToCall are taken from the SetCallback message. message is the callback message that grid has DECided to send, v0,v1,v2,v3 are arguments in support of message, and kid,grid contain the grid and kid that was the initiator of the callback message.
When you click on an XuiPushButton in an XuiDialog2B, or type an Enter key into its XuiTextLine, grid sends a Selection message to FuncToCall() . What FuncToCall() or the functions it calls do is up to your program.