View Single Post
  #2  
Old 04-09-2009, 01:03 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,458
In your case the mouse button event is not being passed on. Would it work to send a mouse event when the button event occurs?
Code:
import viz
viz.go()

import vizinfo
infoObject = vizinfo.add('Give me feedback!')
button = infoObject.add(viz.BUTTON, 'Push me')

def onMouse():
	pos = viz.mouse.getPosition()
	print 'mouse is currently at',pos
	
vizact.onmousedown(viz.MOUSEBUTTON_LEFT, onMouse)

def onButton(obj,state):
	if state == viz.ON:
		viz.sendEvent( viz.MOUSEDOWN_EVENT, viz.MOUSEBUTTON_LEFT )

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