From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Mon Feb 10 2003 - 10:47:37 CST

Lars,

You're correct, there's curently no callback routine that registers
either mouse button events or changes in coordinates that don't come from
files or IMD. For what you're doing, though, do you need continuous
or automatic updates from VMD, or could you instead just create a
little menu with a button that says "Update Python Atoms" or something
to that effect, that you could press when you were done moving atoms?
Obviously automatic updates are nicer in some ways, but this is something
you could do with VMD 1.8.

It wouldn't be too difficult to add a new callback, but I just want to
make sure that a simple Tkinter script wouldn't solve your problem just
as well.

A trick you could do with the callbacks is to set a callback for
display_update, but only check the coordinates once per second, instead
of every time the callback is called. This way you would stay in sync
without imposing much overhead on VMD's display loop.

Cheers,
Justin

On Mon, Feb 10, 2003 at 11:03:58AM +0100, Lars Bruno Hansen wrote:
> Hi Justin
>
> Thanks for the answer about compiling VMD.
>
> I have a question about using the python callbacks.
> The reason for my question is that I want the representation of atoms in
> VMD to follow the representation we are using in our python modules, so
> that any changes in properties of atoms (coordinates, type etc) is
> reflected
> back on our python atoms and the other way around.
>
> I can use the callback 'trajectory' for telling that VMD have imported
> atoms,
> however if an atom is moved using the mouse I could not find an
> appropriate
> callback routine. Using 'display_update' would generate too many
> unnecessary
> updates I think, and would slow things down.
> Is callbacks the right way to implement this, or should one maybe use
> another
> method?
>
> Maybe if a callback routine could be generated then a user is dropping
> the mouse
> after moving an atom or collection of atoms this could be used to
> implement
> this.
>
> Any help on this is greatly appreciated.
>
> with best regards
> Lars
>
> --
> Lars Bruno Hansen,
> CAMP, Dept. of Physics, Building 307, DTU, DK-2800 Lyngby, Denmark
> Phone: +45 45 25 32 16 Fax: +45 45 93 23 99
> E-mail: lhansen_at_fysik.dtu.dk
>

-- 
  Justin Gullingsrud        3111 Beckman Institute        217-244-8946
  I been dropping the new science, and I be kicking the new knowledge,
  and I'm seeing to a degree that you can't get in college.  -- b.boys