Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-13 Thread Alexander Rose
Hi, thanks! by the way, were can I find the parameter list for all callbacks? were in the jmol code are they defined? alex - Ursprüngliche Mail - Von: Robert Hanson hans...@stolaf.edu An: jmol-users@lists.sourceforge.net Gesendet: Dienstag, 13. Juli 2010 07:27:58 Betreff: Re:

Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-13 Thread Angel Herráez
El 13 Jul 2010 a las 11:57, Alexander Rose escribió: by the way, were can I find the parameter list for all callbacks? were in the jmol code are they defined? Alex, I'm trying to document those in http://jmol.sourceforge.net/jslibrary/#jmolSetCallback but I'm doing mostly by trial. If you

[Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-12 Thread Alexander Rose
Hi, I would like to get the file id/number (that is file from the file.model notation, e.g. file1.model1) of a model just loaded into an Jmol applet. I hoped 'set LoadStructCallback someJsFunction' would rescue me, but LoadStructCallback gives only the params 'appletName, fullPathName,

Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-12 Thread Angel Herráez
Alex, if you have just loaded the file, you should be able to use something like the last frame number, wouldn't you? http://chemapps.stolaf.edu/jmol/docs/#jmolmath _lastFrame _modelNumber -- This SF.net email is

Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-12 Thread Robert Hanson
yes -- Angel has it. The variable is _modelNumber. In JavaScript: var currentModel = + jmolEvaluate(_modelNumber) should do it. This should be a string, not a number, since 3.10 is different from 3.1. Remember, though, that multiple models can be loaded when a file is loaded. I think that's

Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-12 Thread Alexander Rose
Hi, thanks Angel, Bob. I tried it, but (not a show stopper) it only works when I do a setTimeout(...), e.g. function myLoadStructCallback(...){ console.log( jmolEvaluate(_modelNumber), jmolEvaluate(_lastFrame) ); // prints the frame id shown before the load setTimeout( function(){

Re: [Jmol-users] how to get the jmol file id for a model just loaded into an applet

2010-07-12 Thread Angel Herráez
Similar finding here. This is my impressions: loadStructCallback Called: upon successful file loading. but... not before the model has finished loading, so its info is not ready yet Do you need to use it in loadStructCallback? Because if I do it in the script line that loads the file, it