WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-27-2016, 10:15 AM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
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?
Reply With Quote
  #2  
Old 06-27-2016, 10:15 AM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
is there any way to fix it?
Reply With Quote
  #3  
Old 06-27-2016, 10:19 AM
haohaoxuexi1 haohaoxuexi1 is offline
Member
 
Join Date: Sep 2015
Posts: 81
if i have more than two checkbox, should I put all of them in one function?
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


All times are GMT -7. The time now is 06:35 AM.


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