View Single Post
  #1  
Old 06-29-2016, 06:20 AM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
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'
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?

If i have two checkbox, should i put the judging condition in the same function?
Reply With Quote