View Single Post
  #4  
Old 07-13-2009, 10:26 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You need to assign the return value of the createButton function to a variable:
Code:
import viz
import button

viz.go()


btn = button.Button()

testbutton = btn.createButton([0.2,0.5], 'testbutton')

def onButton(obj,state):
	if obj == testbutton:
		print 'test'

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