WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 3 votes, 2.67 average. Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 02-15-2005, 12:27 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
OK. Looking at it I was thinking if it does not take too much 'ressources' running in complex applications?!


New question: I'm having trouble with the checkbox-feature. This does not seem to work?!

Help says:
<node2d:button>.get
This action will return the current state of the Button or Checkbox



<node2d:button>.get(

)

Remarks

This action will return whether the Button or Checkbox is down or up.



Return Value

viz.DOWN or viz.UP



Example

button = viz.add(viz.BUTTON)
.
.
.
if button.get() == viz.DOWN:
print ‘The button is currently down’
else:
print ‘The button is currently up’
-----------------------------------------------------------------


this neither:



Code:
balltraceCheckbox = viz.add(viz.CHECKBOX,viz.SCREEN)
print 'balltraceCheckboxState',balltraceCheckbox.get()
if (balltraceCheckbox.get() == viz.DOWN):
	print 'halloIsNotDownasdfasf'
balltraceCheckbox.translate(0.3,0.3)
showBalltraceCheckbox=0




def mybutton(obj,pos):
	print 'halloMyButton',obj,pos
	print balltraceCheckbox.get()
	global ballMaterialDensity,showBalltraceCheckbox
	if obj == radioPine:
		ballMaterialDensity=350
	if obj == radioPlastic:
		ballMaterialDensity=700
	if obj == radioSilver:
		ballMaterialDensity=10490
	if obj == radioIron:
		ballMaterialDensity=2100
	if obj == radioGranite:
		ballMaterialDensity=2691
	if obj == radioGold:
		ballMaterialDensity=19320
	if obj == balltraceCheckbox:
		#showBalltraceCheckbox=pos
		print 'shoabadf:',showBalltraceCheckbox

viz.callback(viz.BUTTON_EVENT,mybutton)
Reply With Quote
 


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 03:55 AM.


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