View Single Post
Old 04-09-2009, 01:03 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,465
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?
import viz

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 )

Reply With Quote