View Single Post
  #12  
Old 06-13-2008, 10:33 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You should not be using yield statements if you are not using tasks. Here is a sample script that displays a dialog without using tasks. Use the spacebar to toggle the visibility of the dialog.
Code:
import viz
import vizdlg
viz.go()

#Create empty dialog
dlg = vizdlg.Dialog(title='Dialog title')

#Link dialog to center of window
viz.link(viz.CenterCenter,dlg)

#Toggle dialog visibility when spacebar is pressed
vizact.onkeydown(' ',dlg.visible,viz.TOGGLE)

viz.add('gallery.ive')
Reply With Quote