Since "background" and "black" are not defined, all that is doing is going
true the first time, then false the second time, I think. Or something like
that. In any case, the parameter is "backgroundColor":
if (backgroundcolor="[x000000]"); background white; else; background black;
endif;
Bob
On Tue, Nov 4, 2008 at 10:21 AM, Paul Pillot <
[EMAIL PROTECTED]> wrote:
> Dear Jmolers,
> I am currently attempting at designing a button to toggle the
> background color. I was wondering if this could be achieve through an
> if statement and I came up with the following script :
>
> if (background=black); background white; else; background black; endif;
>
> It works ok the first time it is run, but the second time the
> background stays white. Apparently the color value remains "black" in
> memory, whereas the background displayed is indeed white (because if
> I replace background white by cpk for example, this script is run)
>
> I tried also to run separate scripts :
> if (background=black); background white; endif;
>
> and
>
> if (background=white); background black; endif;
>
> These work just fine...
>
> (tried on 11.7.8_dev)
> Is there something wrong with the statement I wrote ? Does somebody
> knows how this could be achieve with a single button triggering a
> single jmol script ?
> Thanks,
>
> Paul
>
> -------------------------------------------------------------------------
> 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
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
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
-------------------------------------------------------------------------
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
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users