WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   something about button_event (https://forum.worldviz.com/showthread.php?t=5767)

haohaoxuexi1 06-27-2016 10:15 AM

something 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'
else:
pass

viz.callback(viz.BUTTON_EVENT,onButton)

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

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

viz.callback(viz.BUTTON_EVENT,onButton1)


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

haohaoxuexi1 06-27-2016 10:15 AM

is there any way to fix it?

haohaoxuexi1 06-27-2016 10:19 AM

if i have more than two checkbox, should I put all of them in one function?


All times are GMT -7. The time now is 07:04 PM.

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