From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Feb 20 2002 - 20:48:56 CST

Hi,
  In addition to the HTML-based suggestion mentioned by Paul
in a previous email, there are a few other things you could do
to get the behavior you request:

  - A Python callback (no Tcl equivalent in the released versions yet..)
    Specifically, the "display_update" method is probably most apropos
    at the moment, this will give your script a callback every time
    VMD processes screen redraws etc.
    http://www.ks.uiuc.edu/Research/vmd/vmd-1.7.1/ug/node147.html#9635

  - have VMD listen on a socket and take commands from the Java
    program. This should work with either Tcl or Python.
    A simple VMD script that does this sort of thing is
    available here, though this script is used to let 2 VMD
    sessions work with each other in sync, the same technique
    could be used by your Java program to control VMD:
      http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/vmdcollab/

  - Have VMD poll the Java applet via socket (opposite direction version
    of the item above..)

Let us know if you have more questions.

Thanks,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Feb 20, 2002 at 03:25:44PM -0800, jen ramus wrote:
> I am trying to load .pdb files into VMD from a java
> application as a user selects files from a table.
>
> I can open VMD and load the first file but have to
> open a new instance of VMD for each subsequent file
> using the command
>
> vmd fileName.pdb.
>
> Using a Python script I can load subsequent files into
> the same instance of VMD with the command
>
> load('pdb', "fileName.pdb')
>
> Unfortunately I have found it impossible to create a
> thread with a timer in the Python script running from
> VMD. The thread class can not be used.
>
> There seems to be no way to have VMD run a Python
> script periodically. Could you please tell me the best
> way to resolve my problem?
>
> Jennifer
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078