On 01/14/2014 04:11 PM, Roberto Mosca wrote:
> Dear all,
>
> I am new to Jmol and I have a problem I could not fix by reading the Jmol
> documentation.
>
> I have a JSmol pane in my web page and I set a callback function for pick,
> which is called pickResidue:
>
>    function pickResidue(jmolObj,msg,atomNo) {
>    var atomIndex = atomNo+1;
>    var atomInfo =
> Jmol.getPropertyAsArray(jmolApplet,"atomInfo","atomIndex="+atomIndex+"");
>    }
>
> The function is correctly called when the user clicks on an atom.
>
> The question is: how can I retrieve the "label" of the atom that was
> clicked? I set such label in a Jmol script using the "set hoverLabel"
> command and I would like to read it back in the pickResidue function to
> decide what to do (visualize some information or not).
>
'Jmol.evaluate' can be used to retrieve almost anything from Jmol.
The following should work (not tested):

Jmol.evaluate(jmolApplet, "print {atomNo=" + atomNo + "}.label");

Regards,
Rolf
-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax:     +49 3641 65 6210
E-Mail:  [email protected]
Website: http://www.fli-leibniz.de

           Scientific Director: Prof. Dr. K. Lenhard Rudolph
        Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to