Eric Martz wrote:
>At 8/14/06, Bob Hanson wrote:
>
>
>>Eric Martz wrote:
>>
>>
>>>With messageCallback, each line of the header is returned as a separate
>>>call, and I get to insert "\n" after each one, so it is platform independent.
>>>
>>>
>>This surprises me, since messageCallback does not parse the header into
>>separate lines on its way to the callback but instead takes the whole
>>chunk and delivers it in one full swoop. Always has; always will. It uses
>>the function:
>>
>> showString(modelFile.substring(0, ichMin));
>>
>>which means it shows the header as one single string. So I think you must
>>be thinking about something else.
>>
>>
>
>Thanks for the info about callback vs getProperty (off list).
>
>I think you are incorrect about callback lines.
>I am using applet 10.2.0.
>My callback function (simplified for purposes of discussion) is
>
>function jmolMessageCallback(appletNumber, message)
>{
> // COLLECT MESSAGES
> if (collectMessages)
> messageStream += message + "\n";
>}
>
>I use this to collect messages from "show pdbheader".
>
>To debug, I display the messageStream in a browser window between
><pre>...</pre> tags.
>
>Before I added the + "\n", the messageStream was one long line (verified by
>escaping it to look for nonprintable characters) -- no line delimiters at all.
>
>
>
Well, I can assure you that only one call to the message callback is
made when you "show pdbheader", even in 10.2.
You can check this out for yourself at
http://www.stolaf.edu/people/hansonr/test/10.2/new.htm
Each time a message comes back there you see "jmolApplet0:" at the
beginning of the line.
.
Your collectMessages function is the sort of thing we had to resort to
because multiple messages get sent for each script, like "Jmol executing
script" and "Script completed", but the message from "show pdbheader" is
one single message, with "\n" line breaks.
>I like being able to add my own delimiter that is platform independent, so
>my code that uses the messageStream only has to deal with one form of line
>ending.
>
>
I wonder how that works.
>I am using arbitrary string signals in the message stream to detect when
>the pdbheader is started and finished, and then initiate processing. It is
>working fine in Firefox (Mac, Win), Safari (Mac) and IE (Win).
>
>
>
Right, it should be no problem to continue using callbacks. You may
notice some slight changes in messages in 11.0, but nothing major.
(Like, for example, now when you use pickCallback, it reports the xyz
coordinate as well, not just the identity. And we now have hoverCallback.
Bob
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users