View Single Post
  #1  
Old 04-02-2011, 07:47 AM
Zhi Zhi is offline
Member
 
Join Date: Mar 2011
Posts: 49
How to delay time in Vizard

Hi all,

I want to define a function which will be called when the mouse is clicked. The function will block the viz.MainView for a second. Here is my code:

import viz
import time
def BlockMainView():
viz.visible(viz.OFF)
time.delay(1)
viz.visible(viz.ON)
vizact.onmousedown(viz.MOUSEBUTTON_LEFT, BlockMainView)

However, the delay function seems being executed before viz.visible(viz.OFF) and viz.visible(viz.ON), so that the viz.visible(viz.OFF) seems never being executed. How can I solve the problem?

Zhi
Reply With Quote