Tim and Miguel wrote :
> > Chime provides access to the message stream that passes between browser
> > and plugin (MessageCallBack and PickCallBack). developers can use this
> > access to respond to a user's interaction with the structure - for
> > example, find out what atom was picked, what command was sent and what
> > the response was from the structure, etc. for example, "select protein"
> > sent to Chime returns a string containing the number of atoms selected.
> >
> > the callback parameters in Chime point to custom javascript functions so
> > the developer can decide exactly what to do with the data stream. these
> > are invaluable hooks for developing dynamic mol vis Web sites.
> >
> > any chance to implement something similar in JMol?
>
> MessageCallBack is already implemented ... although it probably has not
> had enough testing.
>
> I don't think that PickCallBack is implemented yet ... can't remember.
>
>
> I strongly recommend that you switch to using Jmol v10pre1.
>
> Miguel
>
> > regards,
> >
> > :tim
> >
I tried to test the messageCallBack method.
I add this parameter to the applet tag :
<param name='MessageCallback' value=echoMessage />
And I created a javascript function to handle the messages :
function echoMessage()
{
txt = "";
for (i=0; i<arguments.length; i++)
{
txt += i + " : " + arguments[i] + "\n";
}
alert(txt);
}
Each time a script is sent, this function is called with 2 arguments :
- the name of the applet
- a message which is always "Jmol script executing..." followed by a second
call if the script includes an unknown command "command expected : blabla
line#1"
So, the MessageCallback method seems to be implemented but is not working as
expected.
For more information on how the MessageCallback method works in Chime and
why it can be usefull :
- every command sent to chime is displayed by this function (when you set
debug=true in the plugin parameters)
- when a selection is done, the number of atom selected is displayed
- when an atom is clicked, its references are given
- show chain, show model, show information, show pdbheader, show sequence,
show view, send a message back to the user via this method. As Tim told,
these functions are very usefull in dynamics web sites.
In the following page by Eric Martz, you can see how this works in Chime.
http://www.umass.edu/microbio/chime/chimehow/fs_cmdln.htm
Paul
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
Jmol-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-users