> how does the lib know which callback to call?
It depends each time. There are some in several modules of
the lib,
there are several kinds of function with callbacks as
argument: for drawing,
for packaged file management, for timers, for animations on
frames, also in
its custom gui, and to add new file format management as
here is this
exemple:
(by default, only .wav and .voc sound files are handledby
the lib)
SAMPLE *load_mp3(const char *filename) {
...
}
SAMPLE *load_ogg(const char *filename) {
...
}
register_sample_file_type("mp3", load_mp3,
NULL);
register_sample_file_type("ogg", load_ogg,
NULL);
So as you can see here, the function
register_sample_file_type() can be called
with *several* different callbacks, in this example the
correct callback will
be called according to the file type when the user calls
load_sample(filename);
(but when callbacks are called is different for each
function of the different
modules of the lib related to what does each function)
As said previously a hack have to be found to bind this kind
of functions,
since the method given in the ocaml manual will not work
here.
Archives up to November 11, 2006 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
The archives of the very official ocaml list (the seniors'
one) can be found at http://caml.inria.fr
Attachments are banned and you're asked to be polite, avoid
flames etc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http:/
/groups.yahoo.com/group/ocaml_beginners/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
ht
tp://groups.yahoo.com/group/ocaml_beginners/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:ocaml_beginners-digest@yahoogroups.com
mailto:ocaml_beginners-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
ocaml_beginners-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|