Yes, this information comes back as a string in the pickCallback (second
parameter). The third parameter is an atom index:
0+ atom
-2 draw
-3 bond
Also, you can always check the most recent pick information using
var x = jmolEvaluate(_pickInfo)
or
var x = jmolEvaluate(_atomPicked)
You should be able to parse that as a JavaScript array directly:
var info = eval(jmolEvaluate(_pickInfo))
or from that second parameter, HOWEVER -- strings passed back to JavaScript
are Java strings, not JavaScript strings, so ALWAYS do
"" + xxx
to turn them into JavaScript strings before you do anything with them. So in
a callback:
function myPickCallback(app, msg, atomIndex) {
var info = eval("" + msg)
}
not just
function myPickCallback(app, msg, atomIndex) {
var info = eval(msg)
}
Bob
I've put sample JAR files up in
http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11_5.jar
(transferring now - takes a few minutes)
Bob
On Sat, Aug 30, 2008 at 3:09 PM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
> Bob,
>
> (This seemed to have been bounced -- so I'm trying again)
> I am trully overwelmed. This is great! It should work; I would like to
> pass the ID of the 'picked' bond to a javascript variable. Is the report
> returned to the pickCallback function as is atom picking, such that the ID
> can be parsed out. Or is there another way (jmolEvaluate?) to pass the
> report or ID to a javascript variable? I'll admit to confusion about
> passing getProperty info to javascript.
> Thanks.
> Steve
>
>
>
> ----------------------------------------------------------------
> This message was sent using Marietta College WebMail.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users