Quoting Miguel <[EMAIL PROTECTED]>:
Can you explain more about using the MessageCallback function.
I have never used it ... others have.
Is there a documentation for its use.
Maybe.
You also mentioned that its not
implemented in Jmol.js, than how should I use it with my application,
as I am using Jmol.js library.
The MessageCallback method is somewhat complicated.
It tends to uncover bugs in the browsers in the interface between
JavaScript and Java.
I have not implemented it in Jmol.js because I want the Jmol.js library t=
o
be reliable and portable across browser platforms.
Since I also needed the message callback function I added a single line to the
Jmol.js library in the function "_jmolApplet" to activate it:
boxfgcolor + "' />\n" +
/* ### addition for IDB, by Rolf Huehne ### */
" <param name='MessageCallback' value='_jmolMessageCallback' />\n" +
/* ### end of addition for IDB ### */
" <param name='ReadyCallback' value='_jmolReadyCallback' />\n";
To my page I added the following function:
function _jmolMessageCallback(app,msg) {
if (document.control.jmol_monitor.value.length >5000) {
document.control.jmol_monitor.value=msg + "\n" +
document.control.jmol_monitor.value.substr(0,5000);
} else {
document.control.jmol_monitor.value=msg + "\n" +
document.control.jmol_monitor.value;
}
}
"jmol_monitor" is the ID of a textarea in the form "control" and my function
appends each message from Jmol to the beginning of this textarea as a message
log to a maximum size of about 5000 bytes.
The "msg" variable contains the current message.
I tested this on a few platforms with several browsers and it worked in
all but
one case. (I can't tell you right now the browser version and the OS and Java
version number. It was Netscape/Irix on an older SGI) but at least it didn't
disturb the function of other Jmol.js functions.
Of course it would be better if the callback would work in any browser on any
platform, but this will never happen. So I prefer to have a message callback
that works at least in a lot of cases than having no message callback at all.
Regards,
Rolf
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users