proc mywait { waittime } { set starttime [clock seconds] while {[expr [clock seconds] - $starttime < $waittime]} { } } proc myrotate { axis angle step } { for {set i 0} {$i < $angle} {incr i $step} { rotate $axis by $step display update ui } } proc oldcode {} { mol delete all mol new 1tit mol delrep 0 top mol representation Tube 0.4 6 mol color Name mol selection {protein} mol material Opaque mol addrep top mol rename top {dimer_LGH.pdb} myrotate y 360 5 mywait 10 mol delrep 0 top mol representation CPK 1.4 0.5 8 8 mol color Name mol selection {protein} mol addrep top } package require demomaster proc step1 {} { mol delete all mol new 1tit mol delrep 0 top mol representation Tube 0.4 6 mol color Name mol selection {protein} mol material Opaque mol addrep top mol rename top {dimer_LGH.pdb} } proc step2 {} { myrotate y 360 5 } proc step3 {} { mol delrep 0 top mol representation CPK 1.4 0.5 8 8 mol color Name mol selection {protein} mol addrep top } proc rundemo {} { ::DemoMaster::reset ::DemoMaster::usewindow .test "Test VMD Demo Window #1" ::DemoMaster::addbutton {Start Demo} { step1 } 1 ::DemoMaster::addbutton {Step 2} { step2 } 10 ::DemoMaster::addbutton {Step 3} { step3 } 1 ::DemoMaster::addbutton {Button 4} { puts "button 4" } 1 ::DemoMaster::packbuttons ::DemoMaster::registernexthotkey 1 ::DemoMaster::registerprevhotkey 2 ::DemoMaster::printstatus ::DemoMaster::autorun }