On Fri, Apr 1, 2011 at 11:11 PM, Yingjie Lin <[email protected]> wrote:

> Hi Bob,
>
> > I think you have to be careful not to call JmolScriptWait from a script
> that
> > is already running from a callback message. Not sure if that's the case
>
> I think you just pointed out the problem here. I was calling JmolScriptWait
> from a "pickCallBack".
> But what goes wrong with that?
>

The pickCallBack Java is waiting in Jmol for a return from JavaScript, and
then you ask for the JavaScript to wait for a return from Java.


>
> > here, but are you sure you need JmolScriptWait? I can't remember what the
> > context is of this. What is invoking this script?
>
> I have a javascript function myFunc() which should be executed every time I
> click in the Jmol Applet.
> So I have this:
> jmolSetCallback("pickCallback", "myFunc")'
>
> myFunc() {
>        jmolScript(....);       //changes to Jmol display and some Jmol
> variables;
>        myOtherFunc();  // a javascript function I defined which uses some
> Jmol variables
>                                        // and therefore must be executed
> when the previous jmolScript() is done.
>

then at the end of the script "...." you have there, add:

   javascript "myOtherFunc()"

It will then be called when the queued script is complete

Bob

-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to