Up |
Returns the callback and the user parameter for a given object and for a number event.
If no callback is set for this object and this event, nil is also returned.
fun [u0 I u1 u2] [u1 u2]
Return : [u1 u2] the Scol callback and the user parameter. It returns nil if error.
Error :
typeof win = ObjWin;;
typeof win2 = ObjWin;;
typeof text = ObjText;;
fun destroy (o, u)=
_fooId u;; // Console : 11
fun setCB ()=
let _OBJgetCB win 7 nil nil -> [f u] in // 7 is the window destroy event number
(
_fooS sprintf "f : %d u : %d fun : %d" [f u @destroy]; // Console = "f : 442377 u : 11 fun : 442377"
_CBwinDestroy win2 f u; // the same cb and user parameter than win is applyed to win2
0
);;
fun main ()=
_showconsole;
// ...
set win = _CRwindow _channel nil 200 250 400 500 WN_NORMAL "A";
set win2 = _CRwindow _channel nil 500 250 400 500 WN_NORMAL "B";
// ...
_CBwinDestroy win @destroy 11;
setCB;
// ...
0;;
TO DO : at this time, it is not "user friendly" to obtain the event number :
the user must look for it from the object source code.
We add progressively this number in the callback documentation.