Piero,

As Angel pointed out there was a typo in the instructions on the web  
page (Still in the .js file, I will fix that later today:).  In  
addition you are misunderstanding the format for the array.  See below  
for corrections...

Jonathan
On Jul 20, 2010, at 6:32 AM, [email protected]  
wrote:

> Date: Tue, 20 Jul 2010 12:22:52 +0100
> From: P.Canepa <[email protected]>
> Subject: Re: [Jmol-users] New version of jmolColorPickerBox that      may
>       solve   Piero's problem
> To: "[email protected]"
>       <[email protected]>
> Message-ID:
>       <[email protected]>
> Content-Type: text/plain; charset="us-ascii"
>
> I got your script
>
> I was trying to use it
>
> my HTML page has  the script set like that
>
>
> <script type='text/javascript'>
>    var Colorscript = new Array (setAtomColor);
try var Colorscript = [setAtomColor, "atomColor"];
>
>    jmolColorPickerBox(Colorscript, 'rgb(100,100,100)')";
why the double quote at the end of the line? Note the change to [ from  
( below.
try jmolColorPickerBox(Colorscript, 'rgb[100,100,100]');
> </script>
>
> The array Colorscript should be the array  which include the name of  
> the function to call
>
> the function setAtomColor() is  written as :
>
> var atomColor = "";
>  function elementSelected(element){

>       setValue("select none; halo off; label off");
>       setValue("select "  + element + "; halo on; label on");
>
>       atomColor = "' color " + element;       
>   return atomColor;
>  }
>
>
>
> function setAtomColor (rgbCodeStr, Colorscript , jmolApplet0,  
> atomColor){
try function setAtomColor(rgbCodeStr, Colorscript,appletID){
>   var finalColor =  " " + atomColor + " " + rgbCodeStr + " ";
>   return finalColor;
instead of returning the script send it to Jmol.
eg.
jmolScript(finalcolor,appletID);
> }
>
> I think I got your explanation wrong  in the headings of your  
> script. Is the rgbCodeStr the color selected by jmolColorPickerBox ?
> Thanks a lot, Piero

                          Dr. Jonathan H. Gutow
Chemistry Department                                 [email protected]
UW-Oshkosh                                           Office:920-424-1326
800 Algoma Boulevard                                 FAX:920-424-2042
Oshkosh, WI 54901
                  http://www.uwosh.edu/facstaff/gutow






------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to