scriptWait() should do precisely what you are interested in doing. I
think you just haven't found the right way to wait on that thread.
BUT there are a few eval commands that start animation threads, and
these threads may not wait. For them you have to add something like
delay 5 #wait 5 seconds
to allow for the animation to complete
I just did this:
jmolScriptWait("load 1crn.pdb;isosurface solvent")
which takes several seconds to render the solvent-excluded surface for
1crn, and it waited. (That was from an applet, but there's no
difference for an application, I think.)
Bob
[EMAIL PROTECTED] wrote:
>(This refers to Bob Hanson's Jmol 10.x branch)
>
>Hi,
>
>I'm writing an application which is basically an extended version
>of the Jmol app, and I need to issue scripting commands
>via viewer.script() or similar methods.
>
>I would like to be able to give a number of these commands in
>sequence, but simply doing
>viewer.script(command1);
>viewer.script(command2);
>
>doesn't work. I expect this is because the scripting commands
>happen in a thread in Eval, but I don't know enough about threads
>to know what to do about this.
>
>Sometimes I can get away with
>viewer.script(command1 + ";" + command2);
>
>but sometimes the logic required to construct command2 depends
>on what I did in command1 (e.g. loading a molecule).
>
>What I want is a method which executes a script, then
>waits for the script to finish, then continues.
>I've tried scriptWait(), and a while (isScriptExecuting()) loop
>with no success.
>
>Any ideas or explanations of what I'm doing wrong gratefully received,
>
>Thanks
>
>Dave
>
>
-------------------------------------------------------------------------
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-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers