![]() |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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. |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| <multimedia:image>.setImageData question | shivanangel | Vizard | 0 | 01-28-2014 08:43 PM |
| question about NVIDIA 3D vision | Weihua An | Vizard | 5 | 08-02-2010 07:49 AM |
| how to invoke command line question | billjarrold | Vizard | 2 | 01-11-2010 09:51 AM |
| General question and question regarding arrays | dan12345 | Vizard | 1 | 01-15-2008 11:15 AM |
| Stereo Overlap question | JMOwens | Vizard | 2 | 01-08-2008 09:54 AM |