From: Daniel C. <dan...@gm...> - 2011-09-20 12:27:35
|
Ah ok, so while I try it let me ask you just one more thing... I label the residues using a complex function called "colorLabel" inside a file called myJMOLfunctions.spt, that you can access at: http://bl210.caspur.it/MODEL-DB/TEST/Jmol-12new/myJMOLfunctions.spt I am thinking that the easiest way would be to make the same label appear in the textbox by adding something similar to the following (after line 122 of the spt file): var textbox = "NAT - " + info + " %m_%c_%r " + desc + ":" + larcav var t = '\n' + document.getElementById('msg').value document.getElementById('msg').value = textbox + t Can I do that in a Jmol function? I guess not, right? If there is a way to do show it would be the easiest... 2011/9/20 Paul Pillot <pau...@ac...> > You probably don't need any messagecallback here. You can reflace your Jmol > checkbox by any html object (a link for example) and attach to it an onclick > event that would trigger your msgFn() function : > > <a href="#" onclick="msgFn()">Click me !</a> > > function msgFn() { > var x = jmolScriptWaitAsArray("show residue")[0][0][3] > document.getElementById('msg').value = x +"\n" + > document.getElementById('msg').value; > } > > Le 20 sept. 2011 à 13:47, Daniel Carbajo a écrit : > > Ops sorry I copied the wrong line, it is: > jmolSetCallback("MessageCallback","msgFn"); > Which does not work either... So I want that the selected residue appears > when I click on a jmol checkbox. Please check my example page: > http://bl210.caspur.it/MODEL-DB/TEST/testpage3.php > > 2011/9/20 Paul Pillot <pau...@ac...> > >> >> Le 20 sept. 2011 à 12:26, Daniel Carbajo a écrit : >> >> > I am trying the following (which does not work): >> > >> > javascript function: >> > function msgFn() { >> > var x = jmolScriptWait('print script("show residue")'); >> > var t = '\n' + document.getElementById('msg').value; >> > document.getElementById('msg').value = x + t; >> > } >> > >> > >> > as initializing the applet: >> > jmolSetCallback("MeasureCallback","distFn"); >> > >> There is something weird here : you trigger the distFn() function when >> user make a measure. But you've defined au msgFn() function. So it can't be >> triggered by the measure Callback. >> You have to be clear about when you want to update the selected residues >> list. Is it when a user makes a measure ? is it when the user clicks on a >> link or a button ? >> >> You can also use your browser to debug your javascript to see if your >> functions work as expected. For example, you can open the javascript console >> and type in : msgFn() >> you'll see if the list of residues is correctly displayed. >> >> > I would also like to include the temperature factor of the residue's >> C-alpha... any clue? >> Just a clue... print {6}.temperature will provide you with the mean >> temperature factor for all residues numbered 6. There is a way to get the >> list for each residue but I haven't done that for a while and I can't >> remember what the proper syntax is. >> >> >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> Jmol-users mailing list >> Jmo...@li... >> https://lists.sourceforge.net/lists/listinfo/jmol-users >> > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > > http://p.sf.net/sfu/splunk-d2dcopy1_______________________________________________ > Jmol-users mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-users > > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Jmol-users mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-users > > |