WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-12-2008, 05:29 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The show method just sets the dialog visible, waits for either the accept or cancel button to be pressed, then hides the dialog. If you do not want to use a task, then you can manually perform these steps. Here is the code for the show command:
Code:
def show(self):
	"""Create task that displays dialog"""
	
	#Show dialog
	self.visible(1)
		
	#Yield until accept or cancel button is released
	d = viz.Data()
	yield viztask.waitButtonUp([self.accept,self.cancel],d)
		
	#Save whether the dialog was accepted
	self.accepted = d.button is self.accept
		
	#Hide dialog
	self.visible(0)
Reply With Quote
  #2  
Old 06-13-2008, 10:01 AM
vizmaster vizmaster is offline
Member
 
Join Date: Aug 2006
Posts: 27
Question

When I add the yield statement I lose visibility of the form. I don't manually change the visibility. What gives?
__________________
VizMaster
Reply With Quote
  #3  
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
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create my own animations michelcm3 Vizard 1 09-21-2007 09:53 AM
how to create morph from the comple characters CD michelcm3 Vizard 9 07-19-2007 10:15 AM
Alpha and Texturing questions Manny Vizard 3 03-08-2007 11:55 AM
General Questions about Vizard: World Viz dav Vizard 5 08-28-2006 03:44 PM
Antialiasing questions oodini Vizard 1 12-06-2005 12:08 PM


All times are GMT -7. The time now is 03:39 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC