WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-15-2017, 12:05 PM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
Smile about checkbox

Code:
def onButton_trigger(obj,state):
                	
	#judgement for x axis
	if obj == r_checkbox_x: 
		if state == viz.DOWN: 
			print "state=down"
								
		else: 
			print "state=up"
					
	#judgement for y axis
	if obj == r_checkbox_y: 
		if state == viz.DOWN: 
			print "state=down"
									
		else: 
			print "state=up"
			
	#judgement for z axis
	if obj == r_checkbox_z: 
		if state == viz.DOWN: 
			print "state=down"
									
		else: 
			print "state=up"

viz.callback(viz.BUTTON_EVENT, onButton_trigger)
is that possible to set up some limit to guarantee that there is only one "obj" to be checked?

For example, when obj == r_checkbox_z state is down, the states of obj == r_checkbox_x, obj == r_checkbox_y are up.

The states of the three cannot be "up" at the same time.

Thanks,
Reply With Quote
  #2  
Old 03-16-2017, 01:16 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,467
Yes, each time one checkbox is changed by the user, you could use the button.set command to change the states of the other checkboxes.
Reply With Quote
  #3  
Old 03-17-2017, 10:50 AM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
Quote:
Originally Posted by Jeff View Post
Yes, each time one checkbox is changed by the user, you could use the button.set command to change the states of the other checkboxes.
works well.

thanks,
Reply With Quote
Reply

Tags
chekcbox

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


All times are GMT -7. The time now is 10:11 AM.


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