From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Thu Nov 08 2001 - 10:59:52 CST

Hi,

> On principle, it should work like this (version 1.0):
> -----------------------
> gopython # switch to python, I have no clue about Tcl!

Cool, Python!

>
> import VMDCallback
>
> def test(molid, frame): # define a method
> print "next, please"
>
> f2 = test
>
> VMDCallback.add_callback('frame',f2) # register the method
> ------------------------
>
> This prints a very useful message every frame and I would guess it could
> be used to change the coloring of each frame. I can't do it right now (and
> my vmd-scripting experience is extremely limited, i.e. near 0) but if
> anyone could give some hints ... :o)

Check the Python section of the User's Guide; the command you need is
molrep.modrep.

>
> I, in fact, already failed with the visibly more advanced version 2.0:
>
> def test(molid, frame): # define a method
> if frame % 50 == 0:
> print "next, please"

I think what you want is:

import math
def test(molid, frame):
        if not math.fmod(frame, 50):
                print "next, please"

>
> I could register this method but nothing happened..
>
> Thanks for comments!
> Raik
>
>

-- 
Justin Gullingsrud      3111 Beckman Institute
H: (217) 384-4220       I got a million ideas that I ain't even rocked yet...
W: (217) 244-8946       -- Mike D