WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 06-29-2016, 06:20 AM
haohaoxuexi1 haohaoxuexi1 is offline
Join Date: Sep 2015
Posts: 81
question about BUTTON_EVENT

checkbox = viz.addCheckbox(pos=(0.5,0.5,0))

def onButton(obj,state):
if obj == checkbox:
if state == viz.DOWN:
print 'Checked'


checkbox2 = viz.addCheckbox(pos=(0.5,0.5,0))

def onButton1(obj,state):
if obj == checkbox2:
if state == viz.DOWN:
print 'Checked'


when i write the code as above, why is the system only execute the later BUTTON_EVENT but not both of them?

If i have two checkbox, should i put the judging condition in the same function?
Reply With Quote
Old 06-29-2016, 09:20 AM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,465
I think this is expected behavior when two buttons are stacked on top of each other. What is the reason for having two buttons in the same position?

You could use the vizact.onbuttondown command and register a callback function for each button.
Reply With Quote

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
<multimedia:image>.setImageData question shivanangel Vizard 0 01-28-2014 07:43 PM
question about NVIDIA 3D vision Weihua An Vizard 5 08-02-2010 06:49 AM
how to invoke command line question billjarrold Vizard 2 01-11-2010 08:51 AM
General question and question regarding arrays dan12345 Vizard 1 01-15-2008 10:15 AM
Stereo Overlap question JMOwens Vizard 2 01-08-2008 08:54 AM

All times are GMT -7. The time now is 04:19 AM.

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